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

    I tried for hours now to create a simple archive for my ditto call, but failed. I even tried the very simplest calls, but they all lead to the same result; So I have a container (id=48) with all my documents inside, and another document (71) with the ditto call.

    I have my documents sorted by a TV named `event-date` (Date, Unixtime), workes fine. But as soon as I want to sort the reflect call by the same date, I get the problem that all documents output the date 1.1.1970.

    Ditto
    [!Ditto? &id=`events-done` &parents=`48` &extenders=`dateFilter` &summarize=`10` &total=`20` &tpl=`aiqa_events` &dateFormat=`%d.%m.%Y` &language=`german` &sortBy=`event-date` &dateSource=`event-date` &filter=`event-date,@EVAL return time();,5|id,70,2|id,71,2`!]


    Reflect
    [!Reflect? &id=`events-done` &targetID=`71` &groupByYears=`1` &getDocuments=`1` &dittoSnippetParameters=`parents:48` &showItems=`1` &dateFormat=`%d.%m.%Y`  &dateSource=`event-date`!]


    Without the &dateSource parameter I get the published dates. But how can I create an archive with the event-date TV?

    Thanks for any help!
      • 16278
      • 928 Posts
      I don’t think events-done is valid as an ID name (Ditto site says: "Any combination of characters a-z, underscores, and numbers 0-9"). Perhaps that is interfering with things.
      smiley KP
        • 25876
        • 79 Posts
        I now changed the ID to `events`, but it makes no difference.

        It’s still about the date issue, with &dateSource=`event-date` my posts are still living in 1970 ...
          • 12028
          • 152 Posts
          I think you had - but anyway: Had you tried Ditto’s debug console? Be sure you’re runs it in uncached mode as you indicate in the snippet call. (Or it won’t work).

          Or maybe: params instead of dittoSnippetParameters in the Reflect call - I can’t see dittoSnippetParameters anywhere in the documentation...

            - A small step for mankind, so why not take two...

            Working with web production, graphic design/workflow, photo and education - but are trying to get a life in between!
            • 36592
            • 970 Posts
            Try changing Reflect parameter from ...
            &dittoSnippetParameters=`parents:48`

            to ...
            &dittoSnippetParameters=`parents:48|sortBy:event-date`

              • 25876
              • 79 Posts
              Quote from: tkfm at Aug 02, 2009, 09:51 PM

              Try changing Reflect parameter from ...
              &dittoSnippetParameters=`parents:48`

              to ...
              &dittoSnippetParameters=`parents:48|sortBy:event-date`



              Thanks tkfm!! WORKED!

              Now, my Reflect is
              [!Reflect? &id=`events` &targetID=`71` &groupByYears=`1` &getDocuments=`1` &monthSortDir=`DESC` &dittoSnippetParameters=`parents:48|sortBy:event-date` &showItems=`0` &dateFormat=`%d.%m.%Y` &dateSource=`event-date`!]

              and my Ditto
              [!Ditto? &id=`events` &parents=`48` &extenders=`dateFilter` &summarize=`10` &total=`20` &tpl=`aiqa_events` &dateFormat=`%d.%m.%Y` &language=`german` &sortBy=`event-date` &dateSource=`event-date` &filter=`event-date,@EVAL return time();,5|id,70,2|id,71,2`!]


              One question left: Is there a way to create the archive only for those documents with `event-date` in the past? All documents are in the same folder (48), but some are set in the future and some in the past. Right now, the archive is of course for all documents in the folder. But I need something like
              &filter=`event-date,@EVAL return time();,5

              just for the Reflect call. Is that possible?

              Thanks,
              Simon
                • 10313
                • 375 Posts
                Quote from: tkfm at Aug 02, 2009, 09:51 PM

                Try changing Reflect parameter from ...
                &dittoSnippetParameters=`parents:48`

                to ...
                &dittoSnippetParameters=`parents:48|sortBy:event-date`


                Very interesting. It works for me, too. But WHY?