We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 38547
    • 98 Posts
    I have read and searched everywhere cant work this out.

    I am using Revo 2.2.6 and I am using get page to show results which works perfect using this code

        [[!getPage?
            &element=`getArchives`
            &tpl=`newsTpl`
            &parents=`28`
            &showHidden=`1`
            &limit=`7`
            &pageVarKey=`page`
            &includeTVs=`1`
            &processTVs=`1`
            &toPlaceholder=`archives`
            &cache=`0`
        ]]
        <h3>Results for [[+arc_month_name]] [[+arc_year]]</h3>
        [[+archives]]
      <div class="paging">
    <ul class="pageList">
      [[!+page.nav]]
    </ul></div>
    <br />
    [[+total]] items found this is page [[+page]] of [[+pageCount]] pages 
    


    I can get all items filtered by month using this code
    <h1>Select by Month</h1> <ul> [[!Archivist? &target=`73` &useFurls=`0` &limit=`120` &parents=`28`]] </ul>


    However the list of months is getting really long and I was wondering if there was a way to show events by years then when the year link is clicked to then show the events by month of that year or something like this.

    Can anyone show me a tutorial or share some code I have scanned everywhere and cant find anything that shows how to do this.

    Many thanks

    Ian [ed. note: ianman last edited this post 13 years, 8 months ago.]
      • 28042 ☆ A M B ☆
      • 24,524 Posts
        Studying MODX in the desert - http://sottwell.com
        Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
        Join the Slack Community - http://modx.org
        • 38547
        • 98 Posts
        Yep thats what I was looking for took a little bit of working out but for info here is what I ended up with

        [[!ArchivistGrouper? &parents=`28` &mode=`year` &depth=`3` &groupTpl=`GroupByYear`]]


        Any my chunk called GroupByYear is this
        <ul>
            <li><a href="[[+url]]">[[+year]]</a>
           
            </li>
        </ul>


        The page result are output from the ArchivistGrouper menu using this
            [[!getPage?
                &element=`getArchives`
                &tpl=`newsTpl`
                &parents=`28`
                &showHidden=`1`
                &limit=`5`
                &pageVarKey=`page`
                &includeTVs=`1`
                &processTVs=`1`
                &toPlaceholder=`archives`
                &cache=`0`
           ]]
            <h3>All results [[+arc_month_name]] [[+arc_year]]</h3>
            [[+archives]]
        
        <div class="paging">
        <ul class="pageList">
          [[!+page.nav]]
        </ul></div>
        <br />
        [[+total]] items found this is page [[+page]] of [[+pageCount]] pages 


        And if anyone really want it just to finish this off my newsTpl chunk is just stripped down version of the default chunk to suit my needs this is what I am using
         <h2><a href="[[~[[+id]]]]" title="[[+pagetitle]]">[[+pagetitle]]</a></h2>
         <div class="date">Published on [[+publishedon:strtotime:date=`%b %d %Y`]]</div> 
         
          <div class="text">[[+introtext]]...</p></div>
        					
        <div class="read"><a href="[[~[[+id]]]]"><img src="/assets/templates/sudburyred/images/but_read.gif" alt="Read More"></a></div>
         
          <div class="clear"></div>
        
        <hr/>


        I hope this helps someone simple code examples to get simple people like me up and running is what this site is most in need of.