We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 37242 ☆ A M B ☆
    • 339 Posts
    Dear MODX people,

    with my new 2.2.6 installation, I encounter a strange behavoir. I have some sidebar content which depends on TVs:
    <h3>Authors of this Topic</h3>
    <table class="autoren">
    [[*AutorText:isnot=``:then=`<tr><td>Text</td><td>[[*AutorText]]</td></tr>`]]
    [[*AutorGrafik:isnot=``:then=`<tr><td>Grafik</td><td>[[*AutorGrafik]]</td></tr>`]]
    [[*AutorVideo:isnot=``:then=`<tr><td>Video</td><td>[[*AutorVideo]]</td></tr>`]]
    [[*AutorAudio:isnot=``:then=`<tr><td>Audio</td><td>[[*AutorAudio]]</td></tr>`]]
    </table>


    The only output is like this:
    Audio]]


    If I fill out all TV's, it's working. What am I missing?

    Cheers,

    Guido
      • 9207 ☆ A M B ☆
      • 2,475 Posts
      Usually if you see something like that, it's because there are problems with your MODX Syntax. I wrote a plugin to help check that: https://github.com/fireproofsocks/SyntaxChecker

      But I confess, it needs improvement for many cases, specifically where there are complex output modifiers.

      Was this same template working in a previous version of MODX?
        • 37242 ☆ A M B ☆
        • 339 Posts
        It's a new site. I am adaptnig the flexibility package of Menno Pietersen. It works for many of my sites.
          • 3186 ☆ A M B ☆
          • 279 Posts
          What I should do is

          [[*AutorText:notempty=`<tr><td>Text</td><td>[[*AutorText]]</td></tr>`]]


          etc.

          But your syntax isn't wrong as far I can see.
            MODX Ambassador (NL) & Professional MODX developer
            Follow me on Twitter | Visit my page on Facebook | View my code on Github | View my script posts
            MODX e-commerce solution SimpleCart
            • 40045
            • 534 Posts
            I also have such problems from time to time, and just no clue why =)...because as Bert says...the syntax looks correct (in my cases I went over it and again and again...), so I think somewhere there is a bug within the modifiers, but I cannot find it...how I usually solve it is more or less by what Bert suggested, just try another modifier =)... :notempty / :isnotempty

            aaaah, and what just comes into my mind! I had big problems when using the :then=``modifier WITHOUT the :else=``modifier, so try to add that at the end and see if it starts working!!

            eg:

            [[*AutorText:isnot=``:then=`<tr><td>Text</td><td>[[*AutorText]]</td></tr>`:else=``]]


            to make it a little bit more readable you could also do:

            [[*AutorText:is=``:then=``:else=`<tr><td>Text</td><td>[[*AutorText]]</td></tr>`]]
              • 37242 ☆ A M B ☆
              • 339 Posts
              Thank you guys - I did it the bert way smiley
              For the record: both ways work. "notempty" and "then... else"
                • 3186 ☆ A M B ☆
                • 279 Posts
                Quote from: gallenkamp at Dec 14, 2012, 11:38 AM
                Thank you guys - I did it the bert way smiley
                For the record: both ways work. "notempty" and "then... else"

                I feel honored ;-)
                  MODX Ambassador (NL) & Professional MODX developer
                  Follow me on Twitter | Visit my page on Facebook | View my code on Github | View my script posts
                  MODX e-commerce solution SimpleCart