We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 32645
    • 377 Posts
    In ditto, &noResults=`` defaults to a preset phrase. I want it to show nothing, an empty string. I tried putting a blank chunk in the &noResults parameter, but it keeps showing the preset phrase.

    How do I go about forcing &noResults to show nothing, or an empty string?
      • 36416
      • 589 Posts
      Quote from: worchyld at Jan 12, 2009, 01:05 AM

      How do I go about forcing &noResults to show nothing, or an empty string?

      Workaround: &noResults=` `
        • 7231
        • 4,205 Posts
        You can also edit the language file, that is where the preset is stored.

        $_lang['no_documents'] = '<p>No documents found.</p>';
          [font=Verdana]Shane Sponagle | [wiki] Snippet Call Anatomy | MODx Developer Blog | [nettuts] Working With a Content Management Framework: MODx

          Something is happening here, but you don&#39;t know what it is.
          Do you, Mr. Jones? - [bob dylan]
          • 32645
          • 377 Posts
          Thank you!

          On a related subject.

          Does &noResults not like HTML tags or something?

          I’ve tried putting XML/HTML tags into a &noResults chunk, but ditto appears to strip all tags... Is there a workaround?

          For example, we have a video player which uses ditto to look at XML files; should a video not exist we want it to say &noResults=`{{play_noResultsvideo}}`

          But everytime I try an XML chunk, ditto appears to rip all tags out.

          Thanks
            • 7231
            • 4,205 Posts
            &noResults=`{{play_noResultsvideo}}`
            Here you are telling it to parse the chunk before using it as a value. Since the MODx parser will choke on some special characters, I think that they are striped. I think that you do not need the {{}}:
            &noResults=`play_noResultsvideo`
              [font=Verdana]Shane Sponagle | [wiki] Snippet Call Anatomy | MODx Developer Blog | [nettuts] Working With a Content Management Framework: MODx

              Something is happening here, but you don&#39;t know what it is.
              Do you, Mr. Jones? - [bob dylan]
              • 10313
              • 375 Posts
              Quote from: Eol at Jan 12, 2009, 02:03 AM

              Quote from: worchyld at Jan 12, 2009, 01:05 AM

              How do I go about forcing &noResults to show nothing, or an empty string?

              Workaround: &noResults=`&nbsp;`

              Sadly, this is not an empty string.
              Even when I set [tt]$_lang[’no_documents’] = ’’;[/tt] something will be output, at least I get a blank line in my web page.
                • 7327
                • 195 Posts
                Quote from: dev_cw at Jan 12, 2009, 09:48 AM

                &noResults=`{{play_noResultsvideo}}`
                Here you are telling it to parse the chunk before using it as a value. Since the MODx parser will choke on some special characters, I think that they are striped. I think that you do not need the {{}}:
                &noResults=`play_noResultsvideo`


                This works. You don’t need the {{}} for calling chunks with XML/HTML code, just specify the name of the chunk within the `` quotes. Thanks!
                  • 3749
                  • 24,544 Posts
                  Quote from: FuryDE at Nov 11, 2009, 08:59 AM

                  Sadly, this is not an empty string.
                  Even when I set [tt]$_lang[’no_documents’] = ’’;[/tt] something will be output, at least I get a blank line in my web page.

                  You should be able to change that by changing the CSS or the Ditto tpl chunk.
                    Did I help you? Buy me a beer
                    Get my Book: MODX:The Official Guide
                    MODX info for everyone: http://bobsguides.com/modx.html
                    My MODX Extras
                    Bob's Guides is now hosted at A2 MODX Hosting