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

    i use getPage snippet with getResource

    for the pagination, i don’t know how to do for just see the prev and next pagination not all the number and first & last

    thanks for your help

    exemple :
    +page.nav.prev

    and
    +page.nav.next
      • 36592
      • 970 Posts
      I did not try this, but how about setting these four template setting to blank ?

      pageNavTpl
      pageActiveTpl
      pageFirstTpl
      pageLastTpl
        • 17422
        • 225 Posts
        I updated the snippet :

        i added a properties

        &AffichernumeroPage=`0` &AfficherFirstLast=`0`


        and add in the snippet :

        $properties['AffichernumeroPage'] = empty($AffichernumeroPage) ? $AffichernumeroPage : 1;
        $properties['AfficherFirstLast'] = empty($AfficherFirstLast) ? $AfficherFirstLast : 1;


        and in the include.getpage.php

         if ($AfficherFirstLast == 1) {
            $nav['first'] = getpage_makeUrl($modx, $properties, $i, $pageFirstTpl);
        }
        
         if ($i == $page && $AffichernumeroPage ==1) {
               $nav[$i] = getpage_makeUrl($modx, $properties, $i, $pageActiveTpl);
             } else if ($AffichernumeroPage ==1){
                $nav[$i] = getpage_makeUrl($modx, $properties, $i, $pageNavTpl);
             }
        
        if ($AfficherFirstLast == 1) {
            $nav['last'] = getpage_makeUrl($modx, $properties, $i, $pageLastTpl);
        }