We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 24100
    • 35 Posts
    Reflect: The dates don’t show up when specifying a template using ’tplItem.’

    The ’pagetitle’ and ’date’ are displayed properly in their default format when no ’tplItem’ is set. If I do specify one, even when using the default template as specified on http://ditto.modxcms.com/files/snippet-reflect-php.html#tplItem, the dates don’t show up.

    Default template and the same code used to test NewsLinksPressArchive:
    <a href="[~[+id+]~]" title="[+pagetitle+]" class="reflect_item_link">[+pagetitle+]</a> (<span class="reflect_date">[+date+]</span>)

    Reflect Call:
    [!Reflect? &dittoSnippetParameters=`parents:13` &id=`press` &targetID=`64` &getDocuments=`1`  &tplItem=`NewsLinksPressArchive` !]

    Ditto Call:
    [!Ditto? &id=`press` &tpl=`NewsLinksPress` &parents=`13` &summarize=`6` &dateSource=`pub_date` &sortBy=`pub_date` &dateFormat=`%m-%d-%Y` &extenders=`dateFilter` !]


    Did I simply miss something or is there another issue?
      • 18397
      • 3,250 Posts
      Try that Reflect call on a page without the Ditto call (maybe even the (blank) template) and let me know if that works.
        • 24100
        • 35 Posts
        The referenced Ditto call is actually on another page (main news page) but I do have a Ditto call in the footer (three most recent news articles) so I set the page template to ’blank’ and the dates still disappear.
          • 18397
          • 3,250 Posts
          Is this on a site where I could take a look?
            • 24100
            • 35 Posts
            Mark,

            I just sent you a PM with the information to view the page and code.
              • 18397
              • 3,250 Posts
              Fixed. There were 2 Reflect snippets installed with the same name. Removed the older RC2 version and it worked.
                • 26693
                • 23 Posts
                Hey Mark,

                More of a ’help me please’ than a bug fix, but when i call my reflect snippet here:
                [!Reflect? &dittoSnippetParameters=`parents:151|summarize:all|extenders:dateFilter|sortDir:DESC|total:all|`&monthSortDir=`DESC`&getDocuments=`1`!]

                It all displays fine, but if I click on a month (Feb for example) is it supposed to filter the results and remove all but the Feb ones?

                It adds discussions-archive.html?reflect_20_month=February&reflect_20_year=2007 to my URL but the results stay the same, is there something I need to include in either the blog template or the call that I may have neglected? The Ditto call on 151 is
                [!Ditto? &parents=`151`&truncText=`View Blog`  &truncLen=`280` &summarize=`5` &tpl=`nl_blog` &paginate=`1`&extenders=`summary,dateFilter` &alwaysshow=`0`&total=`20`!]
                But if I understand correctly then getDocuments forces Reflect to do its own work and ignores the ditto call? Both calls are uncached on pages that are also uncached.

                Having read a few other peoples problems I tried the call on a blank template, and I get the same results when I click on a month, although if I click Feb then March my URL turns to
                /discussions-archive.html?reflect_431_month=February&reflect_431_year=2007&reflect_475_month=March&reflect_475_year=2007


                Hopefully that will be enough info to point you in the right direction to then point me in the right direction.

                Thanks for your help and the amazing amount of work you must have put into these twin snippets.
                  • 18397
                  • 3,250 Posts
                    • 26693
                    • 23 Posts
                    Thanks very much Mark, that thread helped a lot.
                      • 18397
                      • 3,250 Posts
                      Ditto 2.0 Final has been releases and thus this thread locked. Please post all issues with the final release in the Ditto forums. Thanks!

                      This discussion is closed to further replies. Keep calm and carry on.