We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 24495
    • 407 Posts
    Hi, need a push to the right direction:

    I have a folder for all events with subfolders for categories of events (inhouse events, fairs, workshops, ...). For a global overview page I don’t know how to realize this listing:
    - All events, fairs, workshops and so on should be listed in order of their date (yes, it’s possible with Ditto)
    - The listing should have delimiters/headings for month
    - Month should only be visible if not empty (e.g. if any event starts in this month)
    Btw: each category of events has its own overview page realized with Ditto.

    Example:
    - - - - -
    Subfolder: Inhouse events == overview listing for Inhouse events
    - event 1 in march
    - event 2 in may

    Subfolder: Fairs == overview listing for fairs
    - fair 1 in january
    - fair 2 in march

    Subfolder: Workshops == overview listing for workshops
    - workshop 1 in may
    - workshop 2 in july


    Result I need at global overview page:

    January
    - fair 1
    March
    - event 1
    - fair 2
    May
    - event 2
    - workshop 1
    July
    - workshop 2
    - - - - -

    Can anybody help with a tip? Multiple Ditto calls for each month with an empty result for "no documents found"? But how realizing the "month" delimiter/heading? Or is there an other way?
    Thanks for ideas.
      • 24495
      • 407 Posts
      Ok, the subheadings can be realized via the outer template. But then I need 12 Ditto calls (1 for each month).

      Is there a better solution? Maybe I doesn’t see the wood for the trees.
        • 7231
        • 4,205 Posts
        By chance I just did this yesterday. To accomplish it I used a ditto cal for the first level...the months in your case. And an inbeded wayfinder call for the inner links. You can do this with one ditto call, here is the one that I used for an example:

        [[Ditto? &startID=`[+id+]` &display=`all` &sortBy=`sort_order` &showInMenuOnly=`1` &sortDir=`ASC` &tpl=`dtrowTpl`]]

        And in the ditto tpl I included the wayfinder call as follows:

        <h3><a href="[~[+id+]~]">[+longtitle+]</a></h3>
        		[!Wayfinder? &startId=`[+id+]`!]
        		<p>[+introtext+]</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]
          • 24495
          • 407 Posts
          Nice idea. But I should try this with an inner Ditto call. I need more than links for the inner event listing. The inner listing needs Ditto template definitions (date, text and a link).

          Is there anybody out there who knows wether I can nest Ditto calls, e.g. a Ditto call within a Ditto template?