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

    I’m using the following syntax to display the description if it contains a value, if not then out put somthing else.
    [[*description:notempty=`[[*description]]`:else=`test`]]
    


    for some reason it always outputs the the else value.

    I’ve test to see if the notempty is working with a basic call and all seems fine, this is what i used and it only outputted the description and the text "test" if i had a descriiption value. So this part is defo working:
    [[*description:notempty=`[[*description]] test`]]
    


    Thanks

    Ben
      • 1778
      • 659 Posts
      Did you try with calling it uncached ?

      [[!*description:notempty=`[[!*description]]`:else=`test`]]
      
        • 17499 ☆ A M B ☆
        • 872 Posts
        Cached/Uncached worls also with TVs?

          • 28215
          • 4,149 Posts
          Quote from: bennyb at Aug 20, 2010, 05:55 AM

          I’m using the following syntax to display the description if it contains a value, if not then out put somthing else.
          [[*description:notempty=`[[*description]]`:else=`test`]]
          


          ’else’ doesn’t work in that instance; ’else’ only works with the conditional filters, such as if/then/is/eq/gt/lt/or/and.
            shaun mccormick | bigcommerce mgr of software engineering, former modx co-architect | github | splittingred.com
            • 1778
            • 659 Posts
            I believe in Revo cached/uncached works with each element (ie: TV, chunks, snippets...)
            Cheers
              • 17499 ☆ A M B ☆
              • 872 Posts
              Il would have written it like that:

              [[*description:notempty:then=`[[*description]]`:else=`test`]]
              


                • 17499 ☆ A M B ☆
                • 872 Posts
                Quote from: anso at Aug 20, 2010, 07:52 AM

                I believe in Revo cached/uncached works with each element (ie: TV, chunks, snippets...)
                Cheers

                I believed that it was only for the snippets like Evo.
                  • 36926
                  • 701 Posts
                  Thanks all for the replies. I’ve tried cached and uncached. I’ve also tried your way lossendae and still no success, still always renders the else value.

                  As splittingred mentioned else will only work with conditional filters I thought I’d try

                  [[*description:if=``:then=`text`:else=`[[*description]]`]]
                  


                  It still renders the else value, which this time is the description but when empty won’t render the then value. Should the above work. Also tried cached unchached etc.
                    • 28215
                    • 4,149 Posts
                    [[*description:if=`[[*description]]`:eq=``:then=`text`:else=`[[*description]]`]]
                      shaun mccormick | bigcommerce mgr of software engineering, former modx co-architect | github | splittingred.com
                      • 36926
                      • 701 Posts
                      Quote from: splittingred at Aug 20, 2010, 08:28 AM

                      [[*description:if=`[[*description]]`:eq=``:then=`text`:else=`[[*description]]`]]

                      Your the man, thanks!!!!! It works perfect. Nice one

                      Ben