Conditionally Displaying Results in Templates




  • Avatar
    de Kale ICT

    Hi Scott,

    how can i use that with the Shortlist token ? So i want to show some HTML when it is on the shortlist and some other html when it is not on the shortlist.

    F.i. i want to show a 'plus'-button when it is not on the shortlist and a 'minus'-button when it is on the shortlist.



  • Avatar

    The only solution that I found is to template the localization files. Just change the "Add to" with an image source.


    Hope it helps!

  • Avatar

    Hi Scott,

    that's already very good, but a little cumbersome, if I may. If I understand well, I can embed any field within an [HASVALUE:ABC] token more or less like this:

    [HASVALUE:ABC]..div class abc.. [CAPTION:ABC]: ..span class abcfield..[CUSTOM:ABC]../span.. ../div..[/HASVALUE:ABC]

    (I faked the divs, not knowing if they render or not here.). Or is there a better way of testing if a field is empty?

    I also would like to display the entire entry according to its enable/disabled boolean status. Is there a clever way to that? I guess that if I start the View layout file with that if encompassing the whole entry it will display an empty page, but it will still be there.

    In other words, how best to make an database entry (not just a field) appearing or not to visitors?



  • Avatar

    Well, forget my second question, I just realized it can be done with the 'published' flag, of course...

Please sign in to leave a comment.

Powered by Zendesk