We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 28376
    • 222 Posts


    Basically I want the contents of this variable to show up if the page isn’t the home page but the sub page

    [[!If &subject!=`[[ultimateparent]]` &operator=`is` &operand=`3` &them=`[[*feature_right]]`]]
      • 33968
      • 863 Posts
      Typos!
      [[!If &subject=`[[ultimateparent]]` &operator=`is` &operand=`3` &then=`[[*feature_right]]`]]
      


      Also:
      - you might be wanting to use ’isnot’ instead of ’is’.
      - ultimateparent is by default titled UltimateParent. That needs to match in your snippet call too.
        • 28376
        • 222 Posts
        I tired that but it didn’t work. So if the page isnot ultimate parent then show the variable content.

        [[!If &subject!=`[[ultimateparent]]` &operator=`is` &operand=`3` &then=`[[*feature_right]]`]]
          • 5340
          • 1,624 Posts
          try

          [[!If &subject=`[[ultimateparent]]` &operator=`is` &operand=`3` &them=`[[*feature_right]]`]]


            • 28376
            • 222 Posts
            That is the same code I had in the beginning with the typo
              • 33968
              • 863 Posts
              You still have [tt]&subject!=[/tt], you can’t do that. If you need ’!=’, use &operator=`isnot` instead:
              [[!If &subject=`[[ultimateparent]]` &operator=`isnot` &operand=`3` &then=`[[*feature_right]]`]]
              

              And like I said, use UltimateParent unless you changed the snippet name to lowercase
                • 28376
                • 222 Posts
                Still not working

                [[!If &subject=`[[UltimateParent]]` &operator=`isnot` &operand=`3` &then=`[[*feature_right]]`]]


                I even output [[UltimateParent]] and it works. Showed 1 or 2 depending on the page I was on. I also output [[*feature_right]] on its own and it worked.
                  • 28042 ☆ A M B ☆
                  • 24,524 Posts
                  Can a snippet in Revo use TV tags? Would accessing the TV value via the API work?
                    Studying MODX in the desert - http://sottwell.com
                    Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
                    Join the Slack Community - http://modx.org
                    • 28215
                    • 4,149 Posts
                    You need a ? after [[If
                      shaun mccormick | bigcommerce mgr of software engineering, former modx co-architect | github | splittingred.com
                      • 33968
                      • 863 Posts
                      Quote from: splittingred at Aug 08, 2011, 09:29 AM

                      You need a ? after [[If
                      Hah! Amazing how you can stare at something over and over and not see the obvious rolleyes