We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
  • Hi,

    I wonder if someone can help.

    I have 14 news items to display on my home page. Each items is displayed in descending order by date of publication.

    The first 4 items are displayed using the following:

    <div class="main" id="main-three-columns">
    
                <div class="left" id="main-left">
    
                    [[!getResources? 
                      &parents=`3` 
                      &limit=`4` 
                      &tplFirst=`articleheadline` 
                      &tpl_2=`articlesnextheadlines1` 
                      &tpl_3=`articlesnextheadlines2` 
                      &tpl_4=`articlesnextheadlines3` 
                      &includeContent=`1` 
                      &sortby=`createdon` 
                      &showHidden=`1` 
                      &sortDir=`DECS` 
                      &includeTVs=`1` 
                      &tvPrefix=``]] 
    
                    <div class="clearer"> </div>
                    
                </div>
    


    The last 10 items need to be displayed elsewhere on the homepage. I know I need to use getresources, but the following code simply starts over again with the most recent resource in my parent document:

    <div class="left sidebar" id="sidebar-1">
    
                [[!getResources? 
                &parents=`3` 
                &limit=`10` 
                &tpl=`sidebar1_articles` 
                &includeContent=`1` 
                &sortby=`createdon` 
                &showHidden=`1` 
                &sortDir=`DECS` 
                &includeTVs=`1` 
                &tvPrefix=``]] 
    
                </div>


    Any suggestions?
      • 16278
      • 928 Posts
      I haven’t used getResources on Revo, but looking for the equivalent of Ditto’s &start parameter on Evo,
      offset An offset of resources returned by the criteria to skip
      which would make it &offset=`4`, looks a good bet to me. http://rtfm.modx.com/display/ADDON/getResources#getResources-SelectionProperties
      wink KP
      • kp52 - you are a star. Problem solved. My understanding of this great snippet is also enhanced. Cheers smiley smiley