We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 27498
    • 7 Posts
    Well i am having some problems with the archive, i never got it to work right.

    I have the following.

    • Container with all the news ID=2
    • Page that displays the news and the archive ID=123

    In the page i have the following code, for displaying the news and the pagination and archive
    [!Ditto? &parents=`2` &paginate=`1` &paginateAlwaysShowLinks=`1` &extenders=`summary,dateFilter` &summarize=`5` &tpl=`ditto_blog` &dateFormat=`%d-%m-%y %H:%M` &dateSource=`pub-date` !]
    
    Showing [+start+] - [+stop+] of [+total+] Articles | Page [+currentPage+] of [+totalPages+]
    [+previous+] [+pages+] [+next+] 
    
    ARCHIVE
      [!Reflect?config=`wordpress`  &id=`events-done` &targetID=`123` &getDocuments=`1` &dittoSnippetParameters=`parents:2` &id=`wp` &dateSource=`pub_date` !]
    


    I can get the archive to filter by months when i press in a month it keeps on displaying all the articles/documents i have in the container, what im i doing wrong?

      • 27498
      • 7 Posts
      Any ideas???
        • 27498
        • 7 Posts
        Solved! here is my solution, for a complete archive working getting news from a container using pagination.

        [!Ditto? &id=`blog` &startID=`2` &summarize=`10` &removeChunk=`Comments` &tpl=`ditto_blog` &paginate=`1` &extenders=`summary,dateFilter` &paginateAlwaysShowLinks=`1` &tagData=`documentTags` &dateSource=`pub_date` &dateFormat=`%d-%m-%y %H:%M`!]
        
        Mostrando [+blog_start+] - [+blog_stop+] de [+blog_total+]Noticias
        [+blog_previous+] [+blog_pages+] [+blog_next+] 


        note that place holder have the id that i use in ditto call...

        If you plan on having multiple Ditto calls using pagination on one page or using Reflect in your template make sure you use the &id parameter. Set it to a unique string and then update your placeholders to the format [+id_placeholder+].For example, if you id was foo and your palceholder pagetitle, you should use [+foo_pagetitle+]. Also, If you have PHx installed you will need to call Ditto cached on an uncached page.
        This is from Reflect Documentation - http://ditto.modxcms.com/tutorials/pagination.html

        And for the archive...

        [[Reflect?config=`wordpress` &id=`blog` &dateSource=`pub_date` &dittoSnippetParameters=`startID:2` &groupByYears=`0` &getDocuments=`1` &targetId=`123` &showItems=`0` &tplMonth=`reflect_month_tpl` ]]


        Note the id is the same as in the ditto call.

        That worked perfect for me, let me know if you have any problem.