Hi all!
I don’t know which is the best way to do solve this "problem".
I have a big modx site (more that 1000 docs) and I added the possibility to comment and vote some articles.
The problem I have is that I don’t want to let these options available for all docs but only for some.
I was thinking to use TV in order to have a checkbox in admin to let me choose if comments / votes will be available or not but I don’t know how can I check the tv value in a snippet like this
if ($tv_value = 1) { $modx->getChunk($comments_chunk); }
Thanks
Sara
-
☆ A M B ☆
- 1,056 Posts
Sara,
One way you could easily perform this form of conditional logic is via the PHx plugin:
http://wiki.modxcms.com/index.php/PHx
Download URL:
http://modxcms.com/PHx-1006.html
-
☆ A M B ☆
- 1,056 Posts
Quote from: Sara75 at Sep 04, 2008, 04:39 AM
Thanks all!
dev_cw,
I tried your solution (I think it’s easier and faster)
All it work, but my chunk contents a snippet and it’s not executed, but wrote down 
What you suggest ??
Sara, if your snippet call is [!snippet!], try running it as [[snippet]] when within the chunk. Glad to see you found a solution that worked for you, btw.