We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 33372
    • 1,611 Posts
    I’m having trouble getting the showPublishedOnly parameter to work for me properly with Ditto 2.1. When I add &showPublishedOnly=`0` to my snippet call, I expect the results to be only unpublished documents. But I’m getting both published and unpublished...

    So I checked the Ditto documentation site to see if I was misunderstanding how this should be used, and actually the documentation is self-contradictory:

    showPublishedOnly
    Purpose

    Show only published documents
    Options
    0 show only unpublished documents
    1 show both published and unpublished documents
    Default
    1 show only published documents

    In my experience, I find that &showPublishedOnly=`1` shows only published documents, whereas &showPublishedOnly=`0` shows both published and unpublished. Which may be the way that it’s designed to work, in which case the documentation needs to be corrected. But it’s not what I actually need...

    I have an events page that shows upcoming and recent events (documents in a folder) using two Ditto calls. The upcoming events call returns all of the published event documents, whereas the recent events call returns the ones that are unpublished (I set an unpublish date for each event). So it would be great for my situation if Ditto would show only unpublished events.
      "Things are not what they appear to be; nor are they otherwise." - Buddha

      "Well, gee, Buddha - that wasn't very helpful..." - ZAP

      Useful MODx links: documentation | wiki | forum guidelines | bugs & requests | info you should include with your post | commercial support options
      • 7231
      • 4,205 Posts
      I think that documentation refers to the 2.0 parameters. In 2.1 it changed to have the 3 parameters, published only, unpublished only, and both published and unpublished. Before it only had the first two.

      There used to be a notice to this regard in the history while it was in beta but I did not find it anymore.

        [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't know what it is.
        Do you, Mr. Jones? - [bob dylan]
        • 33372
        • 1,611 Posts
        Quote from: dev_cw at Mar 03, 2008, 05:12 PM

        I think that documentation refers to the 2.0 parameters. In 2.1 it changed to have the 3 parameters, published only, unpublished only, and both published and unpublished. Before it only had the first two.

        There used to be a notice to this regard in the history while it was in beta but I did not find it anymore.
        I thought I remembered seeing a thread about this somewhere before also, but I can’t find it now. Skimming the Ditto class file, it doesn’t look to me as if it has all three options yet. At least not where I’d expect to see this code...
          "Things are not what they appear to be; nor are they otherwise." - Buddha

          "Well, gee, Buddha - that wasn't very helpful..." - ZAP

          Useful MODx links: documentation | wiki | forum guidelines | bugs & requests | info you should include with your post | commercial support options
          • 18397
          • 3,250 Posts
          Thanks to this awesome new forum search engine I found, http://boardreader.com, I located the topic:
          http://modxcms.com/forums/index.php?topic=22398.0
            • 6726
            • 7,075 Posts
            <off topic>Wow Mark very cool search engine thanks for the pointer grin

            And I love the stat thingy too, great !</off topic>
              .: COO - Commerce Guys - Community Driven Innovation :.


              MODx est l&#39;outil id
              • 33372
              • 1,611 Posts
              Thanks for the tip (check the other thread for the solution).
                "Things are not what they appear to be; nor are they otherwise." - Buddha

                "Well, gee, Buddha - that wasn&#39;t very helpful..." - ZAP

                Useful MODx links: documentation | wiki | forum guidelines | bugs & requests | info you should include with your post | commercial support options