We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 41725
    • 1 Posts
    Hello all.

    I am using getPage to retrieve list of versions and display it by 10 items to page.
    Now first items of every page (1,2,3,...) are rendering as tplFirst. But i want that first item on first page only uses tplFirst chunk, first item on second, third and other pages should render as tpl chunk.

    Here is my code:

    [[!getPage@gp? &elementClass=`modSnippet` &element=`getResources` &parents=`10` &limit=`10` &pageVarKey=`page` &includeTVs=`1`  &includeContent=`1` &tpl=`fvc_history` & tplFirst=`fvc_history_first` ]]
    <div id="pagination">
    <p class="tech">Pages: [[!+page.nav]]</p>
    </div>
    


    We are using ModX Revo 2.0.8

    I would appreciate any help.
      • 4172
      • 5,888 Posts
      you can try this.

      create a snippet 'myGetPage' :

      $page = $modx->getOption('page',$_REQUEST,'1');
      if ($page == '1'){
          $scriptProperties['tplFirst'] = 'fvc_history_first';
      }
      return $modx->runSnippet('getPage',$scriptProperties);


      [[!myGetPage@gp? &elementClass=`modSnippet` &element=`getResources` &parents=`10` &limit=`10` &pageVarKey=`page` &includeTVs=`1`  &includeContent=`1` &tpl=`fvc_history`  ]]
        -------------------------------

        you can buy me a beer, if you like MIGX

        http://webcmsolutions.de/migx.html

        Thanks!