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

    I’m trying to use Reflect using `pub_date` as the date source instead of the default `createdon`. However, I suspect I’m not using the date formating correctly as nothing is displayed at all, or if I use the default Reflect templates, everything has the Jan 1970 date.

    Here’s the Ditto call referenced in the Reflect script below incase this is the issue - &id=`news`:
    [!Ditto? &id=`news` &parents=`[*contentID1*]` &tpl=`newsHomeTpl` &showInMenuOnly=`1` &orderBy=`menuindex ASC` &paginate=`1` &display=`10` &paginateAlwaysShowLinks=`1` &tagData=`tags` &tagDelimiter=`, ` &tagDocumentID=`55`!]


    Here’s the Reflect call (btw I’m trying to display this archive list in a sidebar chunk):
    <div class="widget">
    [!Reflect? &id=`news` &targetID=`[*contentID1*]` &getDocuments=`1` &dittoSnippetParameters=`startID:[*contentID1*]` &showItems=`0` &showInMenuOnly=`1` &dateSource=`pub_date` &tplContainer=`monthlyArchiveTpl` &tplYear=`monthlyArchiveYearTpl` &tplMonth=`monthlyArchiveMonthTpl` &phx=`1`!]
    </div>


    Here’s the &tplContainer:
    <h3>Archives</h3>
    <ul class="reflect_archive">
    [+wrapper+]
    </ul>


    Here’s &tplYear:
    <li class="reflect_year">
    <a href="[+url+]" title="[+year:date=`%Y`+]" class="reflect_year_link">[+year:date=`%Y`+]</a>
    [+wrapper+]
    </li>
    


    And here’s &tplMonth:
    <li class="reflect_month">
    <a href="[+url+]" title="[+month:date=`%n`+] [+year:date=`%Y`+]" class="reflect_month_link">[+month:date=`%n`+]</a>
    [+wrapper+]
    </li>
    


    I don’t have PHx installed as it causes Jot not to work (another issue here http://modxcms.com/forums/index.php/topic,12828.20.html) but I’d understood that PHx is included in Ditto calls - I also tried to force it in the Reflect call by using &phx=`1`.

    Any pointers would be appreciated, I’m completely stumped.

    Cheers

    Ben
      • 5532
      • 251 Posts
      Sorry, I forgot to mention that I’ve seen this solution:
      http://modxcms.com/forums/index.php/topic,39145.msg237513.html#msg237513

      But I don’t really understand how to implement the "parents:7" bit in:
      &dittoSnippetParameters=`parents:7|dateSource:myTvDate`

      I’m using a template variable in Manager to set the content ID - so as an example I tried this:
       &dittoSnippetParameters=`parents:[*contentID1*]|dateSource:pub_date`

      Leaving at as "parents:7" generates:
      The Ditto object is invalid. Please check it.

        • 5532
        • 251 Posts
        Went with Wayfinder to create the archive pages instead.