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

    I have a side bar item which is called into a template from a Ditto call. The item is from a page that will appear on the site from time to time so sometimes the page will be unpublished. I’m hoping there’s a way to hide the resulting ditto error of "No documents found" when the page is unpublished - is this possible or is there a better way of accomplishing this?

    Any help would be appreciated.

    Cheers


      • 28042 ☆ A M B ☆
      • 24,524 Posts
      You can change that in the language file (assets/snippets/ditto/lang/english.inc.php); on line 32:
      $_lang['no_documents'] = '<p>No documents found.</p>';

      just leave an empty value, or whatever you want to have there when there are no documents
      $_lang['no_documents'] = '';
        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
        • 16278
        • 928 Posts
        Or just use the snippet parameter &noResults=``
        smiley KP
          • 5532
          • 251 Posts
          Thanks, you guys ’rule the school’ as they say.
            • 5532
            • 251 Posts
            Hi There, I tried the ditto call suggestion as it seemed simpler but I still get the ’No Documents’ error.

            Do we need to put anything in the call, the call is just:
            [!Ditto? &documents=`4` &tpl=`dittosidebarchunk` &noResults=``!]
              • 5532
              • 251 Posts
              I tried a blank chunk which I called with the &noResults=`latestcastingsnone` parameter but in the end a space between the little backward quote thingys worked - not sure if this is correct usage but it works...

              [!Ditto? &documents=`4` &tpl=`dittosidebarchunk` &noResults=` `!]