I have tried this for the first time with multiple calls but it doesn’t work (neither cached nor uncached)... any way to make this possible ?
I’d like to avoid using PHx...
.: COO - Commerce Guys - Community Driven Innovation :.
MODx est l'outil id
I’d like to use this snippeton my site and I think it’s the tool I need for the job at hand, but I don’t have enough programming skills to be confident enough to know what I’m doing.
I’d like the snippet to check to see if the pub_date year is equal to the current year, and if not, display a chunk which will output: "(pub_date year) Archive" to put in the heading of the page. I’ve sorted documents into categories by year, but they are all displayed using the same template. I don’t want the "200x Archive" message to appear when the date of the document shown is that of the current year.
Is this snippet, used with a TV the right way to do this? If so, how would I go about that? I’ve never created a TV before and I’m a little overwhelmed by the complexity (and thus I assume power) of TVs as described in the documentation.
Thanks for your help in advance!
I think if you want to do that, you’ll need to install PHx and use the
conditionnal operators, I don’t think you can do that with TVcnd...
.: COO - Commerce Guys - Community Driven Innovation :.
MODx est l'outil id
Great snippet Mark - what’s the syntax for evaluating against a "null" value - i.e if tv is not empty?
Quick fix : set a default value for the TV, such as "blank", therefore when the TV has not been given any value by the user it has blank assigned.
Now I don’t know if TVCond has the empty value built in...
.: COO - Commerce Guys - Community Driven Innovation :.
MODx est l'outil id
I’ve experimented with PHx and this seems to offer more flexibility for what I need to achieve; basically hiding and showing chunks dependent on whether TV’s have values assigned or not.
One thing I did discover is that PHx doesn’t seem to need installing as a standalone plugin with Modx 0.9.6 when Jot is installed.