We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 27519
    • 275 Posts
    I use the If snippet on one page and it does not work as expected. I actually use it twice on the same page.
    The first one runs fine but then the second one doesn’t.

    I have the following call (this is the second use of the If snippet on the page):

    [[!If? &subject=`[[+type]]` &operator=`eq` &operand=`bungalow` &then=`[[$ExtraFields]]`]]

    Although the value in +type place holder is actually "bungalow" the chunk "ExtraFields" is not copied in.
    I checked this by displaying the {{+type]] placeholder just before the If call and it shows up with "bungalow".

    If I use:

    [[!If? &subject=`[[+type]]` &operator=`eq` &operand=`bungalow` &then=`Hello world!`]]

    ... then the string "Hello world!" appears on the page, as expected.

    Any clues??
      MODx Revolution / MAMP / OS X
      • 1778
      • 659 Posts
      Hello
      You can do the same with input/output modifiers like this:
      [[+type:=`[[+type]]`:eq=`bungalow`:then=`[[$ExtraFields]]`:else=`` ]]
      


      Did not test it but it should work..
      Hope this helps
      cheers
        • 27519
        • 275 Posts
        Hi,

        Thanks, that works quite well. Great tip!

        It’s still puzzling though why that @$! snippet doesn’t work... huh

        Cheers

          MODx Revolution / MAMP / OS X