Forum

Thread tagged as: Question

Pages Navigation: Custom value for "Navigation text" ?

Is it possible to have custom Navigation text when using perch_pages_navigation ?

This is for a sub link, where the top level page has a short title, but I want a longer navigation title for sub link - but it's the same page...

I was think to add a top level page that just redirects to sub page with longer title...

Thanks for any tips!

Stuart Farrell

Stuart Farrell 0 points

  • 7 years ago
Drew McLellan

Drew McLellan 2638 points
Perch Support

You can use page attributes to add something like that. These are accessible in the navigation templates.

https://docs.grabaperch.com/docs/pages/page-attributes/

OK, so yeah can add custom field/ID into Pages template... but if the navigation is being generated by a navigation group, not sure how I can add a different navigation title to show up? Main nav is generated from perch_pages array.

Drew McLellan

Drew McLellan 2638 points
Perch Support

What is the circumstance under which you need it to show up?

  • It's that old chestnut of a section name of the website not actually being a page... like "Overview".

So it should be "Weddings" in top nav... (name of section)

And "Wedding Gallery" in sub nav - as the first page of that section.

Hence why perhaps I should just have a page called "Weddings" which just redirects to "Wedding Gallery". ?? Think I have used this before - when adding a page you select Master Page: "Page already exists, or is a link only" but can't remember exactly how.

All this would not be necessary if I didn't want client to edit page name - but also thought I would use newer "Page Details" tab for "Navigation text".

Drew McLellan

Drew McLellan 2638 points
Perch Support

So does the navigation get output in two different places? Can you give one of those a different template that uses a page attribute instead of the navigation text?

Yes, two different places. However, not sure how I tell template to show different value for just one link? Would I have to create customtemplate for either nav then use custom name for all links yes??

Drew McLellan

Drew McLellan 2638 points
Perch Support

Is the link not on a level above all the others you want to display?

Yes it is. I'm already displaying it with a nav group. But I want to have the navigation link different when in nav group.

Drew McLellan

Drew McLellan 2638 points
Perch Support

Ok, so specify two templates, the first will be used for the first level.

https://docs.grabaperch.com/docs/navigation/perch-pages-navigation/

OK, did that, added new id, added new array pulling in new template for sub nav, all good..... except active state doesn't work??? (See other post).

So this one is closed. Thanks.