We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 24532
    • 5 Posts
    Hi, is there a way to output just nothing if no matching document is found?

    Thx!
    Raven
      • 6726
      • 7,075 Posts
      Yes it is

      [tt]&noResults=` `[/tt]

      ;)
        .: COO - Commerce Guys - Community Driven Innovation :.


        MODx est l'outil id
        • 24532
        • 5 Posts
        Ouch. Thx a lot! laugh (I tried   /   / {{dummy}} and none of those worked) wink
          • 8109
          • 128 Posts
          It is worth noting that the following does not work:

          &noResults=``


          In other words, you must have at least a space inserted in this parameter to get no output. This should be considered a bug.
            Revo 2.0.8-pl
            • 7455
            • 2,204 Posts
            Quote from: drwagner13 at Aug 28, 2009, 08:41 AM

            It is worth noting that the following does not work:

            &noResults=``


            In other words, you must have at least a space inserted in this parameter to get no output. This should be considered a bug.

            nope not a bug, if not set then it will go to defauld seting so you need to set the varible space is then the best option.
              follow me on twitter: @dimmy01
              • 8109
              • 128 Posts
              Thanks Dimmy, you are right.

              In many situations, such as in php, ’’ (two single quotes) following a variable definition indicates that the variable is set to a null value. Of course you can’t pass such a value into a snippet’s script, so that’s why the space is required. Another approach would be to have an &showNoResultsMesssage=`1/0` parameter, which would probably be useful for avoiding any confusion.

              Incidentally, the space is effectively ignored in HTML, so the net effect of the above statement with regard to the on-screen display is that nothing will be displayed.
                Revo 2.0.8-pl