Forum

Thread tagged as: Question, Problem, Configuration

list detail slug

Hello

I have created some list and detail pages and templates which are all working ok.

However I want to display selections of my lists in other pages but how do I adapt my slug to work wherever I filter lists and across my site?

thank you.

Denise Courtney

Denise Courtney 0 points

  • 6 years ago

You could use PerchSystem::set_var('name', 'value') to change the URL based on what page you are on

https://docs.grabaperch.com/docs/templates/passing-variables-into-templates/

Sorry but I cannot see how to work this.

My Example..

Have page in my root stag-hen-destinations.php that contains my list and clicks through to individual detail page, destination.php. Have used standard list and detail templates with slug <perch:content id="slug" for="destcity" type="slug" suppress="true" /> and link <a href="?s=<perch:content id="slug" type="slug" />"></a>

I have another page in a folder stag/stag-destinations.php where I have displayed my list but the slugs don't work and the output I get is https://epicweekends.co.uk/stag/stag-destinations.php?s=bath instead of https://epicweekends.co.uk/stag-hen-destinations.php?s=bath

Drew McLellan

Drew McLellan 2638 points
Perch Support

It looks like you're using a link relative to the current page. Would it help to make your links root-relative?

Duh? How easy was that, thank you! Looking for something more complicated as usual!!!