Forum

Thread tagged as: Question, Runway

Perch Runway: How to link pages that aren’t pages.

In Perch there’s way to link to pages that aren’t generated by Perch (or outside of the CMS page tree), how would I do something similar in Perch Runway?

Here’s my problem:

I’ve created a collection with categories, each category URL looks like this:

  • /projects/refurbishment/
  • /projects/land-and-funding/
  • /projects/new-build/
  • /projects/energy-efficiency/

In the Page view in the CMS the only actual page is ‘Projects’. The rest of the ‘pages’ are categories, they don’t exist in the CMS control panel.

I’m using perch_pages_navigation for my website footer menu, I’d like to be able to list the links to these categories. At the moment the only page perch_pages_navigation is picking up is ‘Projects’.

Hope you can help

Stephen Meehan

Stephen Meehan 4 points

  • 6 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

Are you saying you want to insert the category list at that point in the navigation?

Yes. That's a much more concise way of putting it! :)

Drew McLellan

Drew McLellan 2638 points
Perch Support

The way to do it right now is to use perch_categories() to generate your links, return it to a variable, and then pass it into the template using PerchSystem::set_var().

Then in your template, check if the pagePath matches the path you're looking for, and if so output the category links you passed in.