We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 29839 ☆ A M B ☆
    • 66 Posts
    Hello,
    Let me explain, I have a homepage with following call
    [[!getResourcesTag? &elementClass=`modSnippet` &element=`getResources` &tpl=`teaserList` &tplFirst=`teaser_first` &tplLast=`teaserList_last` &parents=`[[*id]]` &depth=`3` &limit=`4`  &includeTVs=`1` &showHidden=`0` &hideContainers=`1` &cache=`0` &pageVarKey=`page` ]][[!+page.nav:notempty=`
    <div class="paging">
    <ul class="pageList">[[!+page.nav]]</ul>
    </div>
    . As you can see the first post has its own template, the last post also has its own template. So far so good.

    But what is would like to achieve is a way to have a different layout on the second page, third and others to come. Only the initial page should use this call as for the next page i want more results and different tpl’s. Anyone know how to get that result?

    Any suggestions are welcome..
      • 26016
      • 561 Posts
      Hi,
      I haven’t tested it, but I should think that
      tpl_{n}

      would be worth a try.

      http://rtfm.modx.com/display/ADDON/getResources#getResources-AvailableProperties

        MODx and Wordpress development
        Linux, PHP 5.2, MySQL 5.0, Evo 1.05, Revo 2.08-pl, Firefox 4
        • 29839 ☆ A M B ☆
        • 66 Posts
        I think that with
        tpl_{n}
        i can only specify a template for 1 result, say the fifth result for example. So i think the possibilities with this is too limited.
        Thanks for the suggestion...
          • 26016
          • 561 Posts
          Fair enough! I’m a CSS guy, so here’s another idea, somewhat manual, but could help if you’re also a CSS person.

          <div id="doc[[+id]]">
             blah blah rest of template content here....
          </div>


          As you can see, I grab the "id" from the document. I also added "doc", because you can’t start a CSS DIV name with a number. Then you write some special CSS for #doc1, #doc45, and so on. I use this sort of thing a lot. You could use other variables if you want to have groups of items, like a TV for a certain type of product or what-have-you.

          Cheers

            MODx and Wordpress development
            Linux, PHP 5.2, MySQL 5.0, Evo 1.05, Revo 2.08-pl, Firefox 4
            • 22427
            • 793 Posts
            Quote from: thijsvandamme at Jun 01, 2011, 09:41 AM

            I think that with
            tpl_{n}
            i can only specify a template for 1 result, say the fifth result for example. So i think the possibilities with this is too limited.
            Thanks for the suggestion...
            As far as I know the template tpl_5 will applied to every fifth result, so for number 5, 10, 15 a.s.o.