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

    I’m using MODx 0.9.5 with Ditto 1.0.2 and DittoCal 1.1.

    i call Ditto with &sortBy=`pub_date` &showPublishedOnly parameter.

    [!Ditto?startID=`63` &summarize=`100` &format=`json` &dateFormat=`%d-%m-%Y` &sortDir=`desc` &sortBy=`pub_date` &showPublishedOnly=`1` !]


    If i set &showPublishedOnly to ’1’ (default) Ditto send me only published articles, that’s ok.
    If i set to ’0’ i’ve only UnPublished documents, that’s the problem, i want to see previous and next events at the same time on my calendar.

    So i want to know if there’s a way to receive both published and unpublished article in one Ditto’s call...

    Thanks for your help and sorry for my english.
      • 17802
      • 190 Posts
      I’m having the same problem. With &showPublishedOnly set to 0, it would make more sense if Ditto returns both published and unpublished documents. Or not? huh
        Thanks for MODx - I love it!
        • 16216
        • 2 Posts
        I agree with you.
        But apparently Ditto don’t do that.

        Nobody else have this problem ? (and a solution)

        Thanks
          • 18397
          • 3,250 Posts
          The MODx API only allows either documents that are published or not published to be selected, not both at the same time without executing your own SQL query. It is relatively trivial to make the needed changes to Ditto for it to do this, but that begs the question why would you want to show unpublished Docs?
            • 17802
            • 190 Posts
            Well, for example: I’ve built a site for a small cinema. In the site there’s an archive page that shows the names of films that have been screened in the past. Also, there’s a schedule in the site that shows films that will be screened in the future. The schedule is made with Ditto and shows only published documents. After a film had been shown for the last time, the page for this film becomes unpublished and then its title turns up in the archive page, where a Ditto query calls only for unpublished docs. See?
              Thanks for MODx - I love it!
              • 18397
              • 3,250 Posts
              Right but MODx won’t display an unpublished document. Are you saying you are using Ditto to show all films but the old ones don’t link to a page?
                • 22303 MODX Staff
                • 10,725 Posts
                Yep, seems to me you don’t want to unpublish them, just move them to another location that won’t show up in the menu (or mark them to not show up in the menu).
                  • 17802
                  • 190 Posts
                  Quote from: Mark at Jan 04, 2007, 02:41 PM

                  Are you saying you are using Ditto to show all films but the old ones don’t link to a page?
                  Yes, that’s what I’m saying wink
                  It was a quick & dirty solution, I might replace it with something that enables me to have links. The thing is, I can’t find a way to automatically move documents from one folder to another on a set date (is there a way?) and I don’t want the editors to have to log in every time a film expires to do it manually. Unpublishing pages after a film has been shown for the last time seemed like a good solution, because it happens automatically.
                    Thanks for MODx - I love it!