We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 22448
    • 241 Posts
    All,
    i’m at the end of my rope here. I’ve been trying to create a global archive listings using Ditto and Reflect and so far not very successfully.

    The Goal:

    Global (all articles) archive listing in the right column. This listing will be completely independent of whatever is showing in the content area.

    Currently only one archive entry is being displayed even though i specifically entered publish dates from several months into the documents, which are displayed with the articles from the ditto call.

    What i did:
    I followed the steps in this article http://ditto.modxcms.com/tutorials/wordpress-style-archives.html.

    To display the archive list in the template’s right column:

    [!Reflect?config=`wordpress` &targetID=`85` &getDocuments=`1` &dittoSnippetParameters=`parents:58` &id=`archive`!]

    In the documents #85 i have the following:

    <h2>Archive [+archive_month+] [+archive_year+]</h2>

    [!Ditto?id=`archive` &parents=`58` &depth=`3` &hideFolders=`1` &extenders=`dateFilter` &dateSource=`pub_date` &tpl=`inprint_tpl` &sortBy=`pub_date` &summarize=`6` &paginate=`1` &display=`6` !]

    <p>Showing <strong>[+archive_start+]</strong> - <strong>[+archive_stop+]</strong> of <strong>[+archive_total+]</strong> Articles


    <div id="ditto_pages">Pages: [+archive_previous+] [+archive_pages+] [+archive_next+] </div>

    But regardless of what i do I only see an archive entry for the current month (August 2009). I checked the database and the pub_date of the articles exist and varied from April to August. So I would expect to see all of them.

    Any ideas would be greatly appreciated.


    The second issue is making the archive global.
    According to <excerpt from Reflect documentation> Furthermore, Reflect will ONLY show what is currently in the Ditto result set. Thus, if pagination is on it will ONLY show that page’s items. </excerpt from Reflect documentation> This seems to make the global archive impossible if pagination is used. Is there a way to use 2 different Ditto instances for one Reflect call: one as the source and one as the target?

    Thanks in advance.
      • 36592
      • 970 Posts
      Try changing this parameter of Reflect
      &dittoSnippetParameters=`parents:58`

      to
      &dittoSnippetParameters=`parents:58|sortBy:pub_date`

      and add this parameter to Reflect
      &dateSource=`pub_date`
        • 22448
        • 241 Posts
        Thanks tkfm,

        But there’s no change. Still only one archive link for August 2009 is shown.
        Is there some kind of debug option for Reflect. I didn’t see it in the documentation but maybe it’s an undocumented feature.

        Here’s the new call:

        [!Reflect?config=`wordpress` &targetID=`85` &getDocuments=`1` &dateSource=`pub_date` &dittoSnippetParameters=`parents:58|sortBy:pub_date` &id=`archive`!]