We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 33238
    • 388 Posts
    Hello, this is a basic question I think but can't find what I really need.

    I have two TV fields: [[*image]] and [[*title]]

    how can I show/hide content comparing the TV's content using output modifiers?
    for example:

    [[*image]] isempty but [[*title]] notempty show this.


    or

    [[*image]] and [[*title]] notempty show this.


    I was thinking in something like this:

    [[+title:or:[[+image]]:notempty=`Become Crazy!!!`]]


    But unfortunately is not working, I'm calling this with pdoResources, any ideas?

    Thank you!!!! [ed. note: Ysanmiguel last edited this post 10 years, 1 month ago.]
      --
      ysanmiguel.com
      • 40706
      • 128 Posts
      Michael Engel Reply #2, 10 years ago
      Quote from: Ysanmiguel at Sep 16, 2016, 05:41 AM


      I was thinking in something like this:

      [[+title:or:[[+image]]:notempty=`Become Crazy!!!`]]


      But unfortunately is not working, I'm calling this with pdoResources, any ideas?

      Thank you!!!!

      You can`t combine conditional : or with String output modifier :notempty. Also you are breaking the modifier syntax with :[[+image]]:


      So stay in Strings
      [[+title:default=`[[+image]]`:notempty=`Become Crazy!!!`]]


      or use conditional
      [[+title:default=`[[+image]]`:isnot=``:then=`Become Crazy!!!`]]

      https://rtfm.modx.com/revolution/2.x/making-sites-with-modx/customizing-content/input-and-output-filters-(output-modifiers)#InputandOutputFilters%28OutputModifiers%29-Conditionaloutputmodifiers
        • 33238
        • 388 Posts
        Thank you I'll try it.
        Cheers!
          --
          ysanmiguel.com