Forum

Thread tagged as: Question, Error, Podcasts

Podcast Pagination - part 2

Thanks Robert,

I can now see the limited number of episodes on the page, as well as the 'Page of Next' navigation at the bottom. Now the next issue is that the pagination does not display the number of pages available, and when I click the 'next' link, the current page refreshes.

// episodes_list.html

<perch:if exists="paging">
    <div class="paging">
      Page <perch:content id="current_page" type="hidden" /> of <perch:content id="number_of_pages" type="hidden" />
      <perch:if exists="not_first_page">
        <a href="<perch:content id="prev_url" type="hidden" encode="false" />">Previous</a>
</perch:if>
      <perch:content id="page_links" encode="false" />
      <perch:if exists="not_last_page">
          <a href="<perch:content id="next_url" type="hidden" encode="false" />">Next</a>
</perch:if>
</div>
</perch:if>

Really appreciate your help so far!

Kevin Brandon

Kevin Brandon 0 points

  • 6 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

Was this intended to be a reply to an existing thread? If not, can you give us some context?

Hi Drew,

Yes, here is a link to the original post: https://forum.grabaperch.com/forum/12-19-2014-podcast-pagination

Thank you,

Drew McLellan

Drew McLellan 2638 points
Perch Support

Can you show us the options you're using from the page?

Here are the options I am using taken from the 'test.php' page:

<?php perch_podcasts_episodes(perch_get('s'),array(
      'paginate'=>true,
      'count'=>4,
)); ?>

Is this what you are looking for?

Drew McLellan

Drew McLellan 2638 points
Perch Support

Yes, that's what I was looking for, but it looks like you've now resolved this. Is that correct?

Good to hear that the code is good - the output displays 'Page of Next' in the web browser.

The 'Next' text is a link, but links to the same page. The number of pages available is not displaying either.

Here is a small screen capture for what I see on the page:

perch pagination

Does this make sense - I know I must be missing something in the code somewhere.

Thank you,

Drew McLellan

Drew McLellan 2638 points
Perch Support

Your template is using perch:content tags, but you're in the Podcasts app. Try changing them to perch:podcasts tags.

Brilliant, that was exactly what I was missing!

<perch:after>
    </div>
    <perch:if exists="paging">
        <div class="paging">
          Page <perch:podcasts id="current_page" type="hidden" /> of <perch:podcasts id="number_of_pages" type="hidden" />
          <perch:if exists="not_first_page">
            <a href="<perch:podcasts id="prev_url" type="hidden" encode="false" />">Previous</a>
    </perch:if>
          <perch:podcasts id="page_links" encode="false" />
          <perch:if exists="not_last_page">
              <a href="<perch:podcasts id="next_url" type="hidden" encode="false" />">Next</a>
    </perch:if>
    </div>
  </perch:if>
</perch:after>

Thank you,

Sorry Kevin, I looked at this the other day and I really didn't get a chance to test your template and figure it out. But it looks like Drew spotted it and worked you through it.

RK

Hi Robert,

No worries, glad to have one more mystery solved.

Thank you,