We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 1261
    • 27 Posts
    First off, I apologize for the rapid-fire help requests. I’m trying to get this blog up and running before classes start on Monday...

    I’m attempting to follow the Ditto "Wordpress-style archives" tutorial (http://ditto.modxcms.com/tutorials/wordpress-style-archives.html), but I find that the [+wp_day+], [+wp_month+] and [+wp_year+] placeholders are not being populated in my archive display page, nor is the date filter being applied to the results of the ditto call on that page.

    Here’s the Reflect snippet that generates the archive display (it’s in document 3, which is the parent container for the blog entries):
    [!Reflect?config=`alterblog` &targetID=`13` &getDocuments=`1` &dittoSnippetParameters=`parents:3`&id=`wp`!]
    


    and on document 13 (alias: blog-archive.html), which is the archive display:
    <h2>[+wp_month+] [+wp_day+] [+wp_year+]</h2>
    [!Ditto? &id=`wp` &extenders=`dateFilter` &parents=`3` &filter=`hidemenu,0` &tpl=`ditto_BlogEntry` &display=`all` &filter=`hidemenu,0` &tagData=`blog_tags` &tagDelimeter=`, ` &tagDocumentID=`10` &summarize=`20` &paginate=`1` &paginateAlwaysShowLinks=`1`!]
    <p>
    Showing <strong>[+wp_start+]</strong> - <strong>[+wp_stop+]</strong> of <strong>[+wp_total+]</strong> Articles | Page <strong>[+wp_currentPage+]</strong> of <strong>[+wp_totalPages+]</strong> 
    </p>
    <div id="ditto_pages">
    [+wp_previous+] [+wp_pages+] [+wp_next+] 
    </div>
    


    For the record, clicking on one of the links generated by the Reflect instance gets me to the archive page with the following querystring:
    blog-archive.html?wp_month=8&wp_ditto_year=2007&wp_day=false&wp_start=0


    The page displays the ditto call alright, but the date-related placeholders are empty and the ditto output is not filtered by date at all..


    Ditto Version 2.0.2
    ModX Version is 0.9.6,
    MySQL Version is 5.0.30
    PHP Version is 5.2.0-0.dotdeb.3 with Suhosin-Patch 0.9.6.2

      • 18397
      • 3,250 Posts
      I actually encountered the same issue a few days ago while taking a look at a site Ryan (rthrash) was working on. In short, its PHx. You will need to call Ditto cached on an uncached page. I’ve since added this to the Ditto FAQ.
        • 1261
        • 27 Posts
        Huh. I made that change just now and I’m still experiencing the same problem. Content for blog-archive.html is now:
        <h2>[+wp_month+] [+wp_day+] [+wp_year+]</h2>
        [[Ditto? &id=`wp` &extenders=`dateFilter` &parents=`3` &filter=`hidemenu,0` &tpl=`ditto_BlogEntry` &display=`all` &filter=`hidemenu,0` &tagData=`blog_tags` &tagDelimeter=`, ` &tagDocumentID=`10` &summarize=`20` &paginate=`1` &paginateAlwaysShowLinks=`1`]]
        <p>
        Showing <strong>[+wp_start+]</strong> - <strong>[+wp_stop+]</strong> of <strong>[+wp_total+]</strong> Articles | Page <strong>[+wp_currentPage+]</strong> of <strong>[+wp_totalPages+]</strong> 
        </p>
        <div id="ditto_pages">
        [+wp_previous+] [+wp_pages+] [+wp_next+] 
        </div>
        


        For the record, the page is uncachable. The one thing I’m wondering about: Does the DateFilter extender have built-in querystring support? I notice there’s also a Request extender for querystring support which requires the options to be passed as [id]_ditto_[param], not id_[param] -- then again, I’ve tried enabling manually swapping the querystring to that format and it doesn’t work either (with or without Request called in the Ditto call). So, I’m stumped..
          • 18397
          • 3,250 Posts
          Yes, the DateFilter extender has querystring support. From what I can tell, you are doing everything correct. You might try upgrading to Ditto 2.1 Beta 2 and see if that helps things.
            • 16845
            • 26 Posts
            If it’s best to start a new thread, just let me know...

            I am having pretty much the same problem as the original poster.
            I have a Ditto/Reflect Wordpress configuration set up with a Reflect call feeding a URL to a Ditto call on the target.
            The Reflect bit "seems" to be working ok.
            On the Target page, Ditto is called, but the date-related placeholders are empty and the Ditto output is not filtered by date at all.
            All I get is a list of ALL my News items...

            What am I doing wrong?

            Thanks a lot for any help.

            Here’s the code:

            Reflect Call
            [!Reflect?config=`wordpress` &dateSource=`newsdate` &monthSortDir=`DESC` &targetID=`49` &getDocuments=`1` &dittoSnippetParameters=`parents:2`&id=`wp`!]

            Where `2` is my container and `49` is my target.

            Ditto Call
            [!Ditto? &id=`wp` &extenders=`dateFilter` &dateSource=`newsdate` &parents=`2` &tpl=`newsListTemplate` &display=`all` !]


            Example Link created by Reflect
            http://mydomain.com/index.php?id=49&wp_month=1&wp_year=2008&wp_day=false&wp_start=0



            Many thanks in advance.