We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 19180
    • 21 Posts
    I have the pages for my pagination appearing but don’t want the "1" visible if there is only one page of results visible. Is there a solution to this through ditto or templating?
      • 16278
      • 928 Posts
      You can use a snippet in place of the [+pages+] placeholder to output its contents according to the value of [+totalPages+]:
      [!PagePlus?totalPages=`[+totalPages+]`!]

      <?php
      // PagePlus
      // Return content of [+pages+] placeholder if [+totalPages+] is greater than 1, else blank
      // input: &totalPages from Ditto placeholders
      
      if ($totalPages > 1) {
        $output = $modx->getPlaceHolder('pages');
      } else {
        $output = NULL;
      }
      
      return $output;
      ?>

      smiley KP
        • 19180
        • 21 Posts
        It doesn’t seem to display any pages now.