Forum

Thread tagged as: Question, Problem

Portfolio Template Help

Thought I would separate the remaining queries into here.

  1. On a portfolio detail page I would like to have "previous" and "next" links that jump to other detail pages rather than back to the listing page. Is this possible and how as tried <perch:content id="prev_url" type="hidden" encode="false" />" and did nothing.

  2. How do I get pagination links to appear on the listing page like those on your forum and is it mandatory to have to include the paging div class?

  3. How do I create links on my listing page that act as Category filters?

Nigel Coath

Nigel Coath 1 points

  • 7 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

  1. https://solutions.grabaperch.com/architecture/how-do-i-link-prev-next

  2. 'page-links' => true https://docs.grabaperch.com/docs/templates/pagination/

  3. Display the categories, with a link in the template. Include the category path in the link. On the page you link to, read the category path from the URL and filter the region based on it.

Thank you, may I ask in the pref/next solution, where does the code for finding the prev/next item reside? Inside the prev/next template or inside the detail.php?

And if we wanted the prev/next links to always show how would we modify the template as currently it looks like they are set to only show if exists?

Drew McLellan

Drew McLellan 2638 points
Perch Support

Nigel Coath said:

Thank you, may I ask in the pref/next solution, where does the code for finding the prev/next item reside? Inside the prev/next template or inside the detail.php?

Page functions go in the page. Template tags go in the template. So if it's perch_something() it goes in the page. If it's <perch:something /> it goes in the template.

And if we wanted the prev/next links to always show how would we modify the template as currently it looks like they are set to only show if exists?

Remove the if and it'll happen unconditionally.

Excellent thanks.

If I wanted an "All" filter how wouldI accomplish that, doI need to create an "All" category or is there code to display all?

Drew McLellan

Drew McLellan 2638 points
Perch Support

All is the default - just don't filter the results.