We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 12584
    • 208 Posts
    I am trying to output articles by month using the following call:

    [!Reflect?config=`wordpress` &targetID=`2` &getDocuments=`1` &dittoSnippetParameters=`startID:2`!]

    However it just brings up articles from all months in order of the most recent published.

    I must confess to not having done to much searching on this subject is there an quick and easy call for this.

    Thanks

    Forgot to mention I am using version 1.03
      • 20413
      • 2,877 Posts
      Are you using startID (old param) in you ditto call?
        @hawproductions | http://mrhaw.com/

        Infograph: MODX Advanced Install in 7 steps:
        http://forums.modx.com/thread/96954/infograph-modx-advanced-install-in-7-steps

        Recap: Portland, OR (PDX) MODX CMS Meetup, Oct 6, 2015. US Bancorp Tower
        http://mrhaw.com/modx_portland_oregon_pdx_modx_cms_meetup_oct_2015_us_bancorp_tower
        • 12584
        • 208 Posts
        OK the parent page that all the articles are under has the following:

        [[Ditto? &startID=`2` &summarize=`5` &removeChunk=`Comments` &dateSource=`createdon` &dateFormat=`%d-%m-%y` &tpl=`ditto_blog` &paginate=`1` &paginateAlwaysShowLinks=`1`  &extenders=`summary`]]
        
        <div id="ditto_pages">
        Showing [+start+] - [+stop+] of [+total+] Articles
        [+previous+] [+pages+] [+next+]
         </div>
        [[Reflect? &dittoSnippetParameters=`startID:2` &groupByYears=`1` &showItems=1` &tplMonth=`reflect_month_tpl`]]


        Its more or less the same code as in the demo template when installing MODx

        cheers
          • 20413
          • 2,877 Posts
          See this: http://ditto.modxcms.com/index.php?id=45&searched=wordpress&highlight=AS_ajax_highlight+AS_ajax_highlight1
            @hawproductions | http://mrhaw.com/

            Infograph: MODX Advanced Install in 7 steps:
            http://forums.modx.com/thread/96954/infograph-modx-advanced-install-in-7-steps

            Recap: Portland, OR (PDX) MODX CMS Meetup, Oct 6, 2015. US Bancorp Tower
            http://mrhaw.com/modx_portland_oregon_pdx_modx_cms_meetup_oct_2015_us_bancorp_tower
            • 12584
            • 208 Posts
            OK thanks for the code snippet there, the output on the page is near perfect now the only thing I cant get to work to the selecting articles by month/year. when I select the any year it just returns the full list.

            However when I added just the calls for the word press theme from the link you supplied that worked great but the config is very limited on that option.

            So right now I have this code on the main parent page

            <!-- [!Ditto? &startID=`2` &summarize=`5` &removeChunk=`Comments` &dateSource=`createdon` &dateFormat=`%d-%m-%y` &tpl=`ditto_blog` &paginate=`1` &paginateAlwaysShowLinks=`1`  &extenders=`summary`!]
            
            <div id="ditto_pages">
            Showing [+start+] - [+stop+] of [+total+] Articles
            [+previous+] [+pages+] [+next+]
             </div>
            [[Reflect? &dittoSnippetParameters=`startID:2` &groupByYears=`1` &showItems=`1` &tplMonth=`reflect_month_tpl`]]


            And in the side menu of the template I have this code to show articles by month

             [!Reflect?config=`wordpress` &targetID=`2` &getDocuments=`1` &dittoSnippetParameters=`parents:2` &id=`wp`!]


            If I can get the filtering options working everything will be perfect and thanks again for your help.

            I am using 1.03 and ditto version is 2.1.0

            Thanks again

            Ian
              • 20413
              • 2,877 Posts
              1. Assign the &id=`wp` (or &id=`whatever`) to the ditto call as well.
              2. You can pass any ditto param e.g. &year=`2009` to your
              reflect call...
              example reflect call
              [!Reflect? &targetID=`88` &getDocuments=`1` &dittoSnippetParameters=`parents:2|year:2009` &id=`whatever`!]

              example ditto on Resource 88
              [[Ditto?id=`whatever` &extenders=`summary,dateFilter`]]

              Where Resource 2 was the container for the items

              I haven’t tried using multiple reflect calls affecting one and same ditto instance...
              You can also filter the results with the request extender:
              http://www.pogwatch.com/ditto/ditto-extenders/ditto-request.html
              http://modxcms.com/forums/index.php/topic,35926.msg217059.html#msg217059
                @hawproductions | http://mrhaw.com/

                Infograph: MODX Advanced Install in 7 steps:
                http://forums.modx.com/thread/96954/infograph-modx-advanced-install-in-7-steps

                Recap: Portland, OR (PDX) MODX CMS Meetup, Oct 6, 2015. US Bancorp Tower
                http://mrhaw.com/modx_portland_oregon_pdx_modx_cms_meetup_oct_2015_us_bancorp_tower
                • 12584
                • 208 Posts
                ok I am learning lots about the output variations now of reflect which is great, but whatever variation I come up with if say i select the option for articles from January 2008 I get the same output as if I have selected the link March 2010.

                I have tried making the calls uncached ie [! params !] but I cant get it show the just the selected results, the url for say January 2008 looks like this

                http://site.com/index.php?q=press-articles_friendly_url_.string&wp_month=1&wp_year=2008&wp_day=false&wp_start=0


                But the output is the most recently created article 1st to the oldest.

                I cant work out what is over-riding the url string any ideas on what to check.

                Many thanks

                Ian
                  • 20413
                  • 2,877 Posts
                  What is your ditto and reflect call. Try using only one reflect
                  or assign the other to another ditto with another &id=`something`
                    @hawproductions | http://mrhaw.com/

                    Infograph: MODX Advanced Install in 7 steps:
                    http://forums.modx.com/thread/96954/infograph-modx-advanced-install-in-7-steps

                    Recap: Portland, OR (PDX) MODX CMS Meetup, Oct 6, 2015. US Bancorp Tower
                    http://mrhaw.com/modx_portland_oregon_pdx_modx_cms_meetup_oct_2015_us_bancorp_tower
                    • 12584
                    • 208 Posts
                    I have tried changing the parent document and even tried everything on another site still the same problem this is everything I have.

                    Ditto call on parent containing page is
                    [[Ditto? &startID=`121` &summarize=`5` &removeChunk=`Comments` &dateSource=`createdon` &orderBy=`createdon desc` &dateFormat=`%d-%m-%y` &tpl=`ditto_blog` &paginate=`1` &paginateAlwaysShowLinks=`1`  &extenders=`summary` &truncLen=`1000` &truncText=`Read More...`]]
                    
                    <div id="ditto_pages">
                    Showing [+start+] - [+stop+] of [+total+] Articles
                    [+previous+] [+pages+] [+next+]
                     </div>


                    The reflect call is
                    	[!Reflect?config=`wordpress` &targetID=`121` &getDocuments=`1` &dittoSnippetParameters=`parents:121`&id=`wp`!]


                    my ditto_blog chunk is
                    <div class="ditto_summaryPost">
                      <h3><a href="[~[+id+]~]" title="[+title+]">[+title+]</a></h3>
                      <div style="padding:10px 10px 10px 5px;" ><br />on [+date+].</div>
                       [+summary+]
                      <p class="ditto_link">[+link+]</p><hr />
                    </div> 
                    


                    That is just about everything I have, I have tested it on an alternative resource that has child documents spanning back over a year but still no luck. Does the above look ok or do my issues lay else where.

                    Thanks

                    Ian
                      • 20413
                      • 2,877 Posts
                      Your ditto has no &id param
                        @hawproductions | http://mrhaw.com/

                        Infograph: MODX Advanced Install in 7 steps:
                        http://forums.modx.com/thread/96954/infograph-modx-advanced-install-in-7-steps

                        Recap: Portland, OR (PDX) MODX CMS Meetup, Oct 6, 2015. US Bancorp Tower
                        http://mrhaw.com/modx_portland_oregon_pdx_modx_cms_meetup_oct_2015_us_bancorp_tower