Adding Page Numbers (Pagination)

3 posts by 2 authors in: Forums > CMS Builder
Last Post: June 26, 2020   (RSS)

By mark99 - June 24, 2020 - edited: June 24, 2020

So at present I have a fairly basic Previous / Next way of showing page numbers:

    <?php if (!$isp_listRecords): ?>
      <br /><br /><b><u>No records were found!</u></b><br/><br/>
    <?php endif ?>
  <!-- /STEP2: Display Records -->
  
  <!-- STEP3: Display Page Links (Paste anywhere below "Load Record List") -->
    <div align="center" style="font-size:16px;">
    <b>
    <?php if ($isp_listMetaData['prevPage']): ?>
      <a href="<?php echo $isp_listMetaData['prevPageLink'] ?>">&lt;&lt; PREV</a>
    <?php else: ?>
      &lt;&lt; PREV
    <?php endif ?>

    - Page <?php echo $isp_listMetaData['page'] ?> of <?php echo $isp_listMetaData['totalPages'] ?> -

    <?php if ($isp_listMetaData['nextPage']): ?>
      <a href="<?php echo $isp_listMetaData['nextPageLink'] ?>">NEXT &gt;&gt;</a>
    <?php else: ?>
      NEXT &gt;&gt;
    <?php endif ?>
    </b>
    </div>
  <!-- /STEP3: Display Page Links -->

But what I'd like to do is add a link for each specific page number. So instead of having "Page 1 of 2" in the middle of Previous / Next I might instead have "Page 1, 2, 3" etc. and each would be linked to load the specific page if clicked. Likewise the current page you are on would be highlighted in BOLD text. Is there an easy way to do that in CMSB?

By mark99 - June 26, 2020

That's exactly what I was looking for, thanks so much :) .