Topic Closed
daisychain
9 Posts

I'm building a music site, which has individual pages for each artist, and under that, subpages for photos, videos and discography of the artist. Basically on all these pages, I want to display the artist name within the header. The main artist page's label is that artist name, so in the template for those pages, I've simply included  echo $page->label; .

For its subpages, I've created a different template where I'm trying to put the parent page label in the header, with a link back to the parent page. I found the code here: http://gpeasy.com/Forum?show=t876 works well, but I am not experienced with this at all so don't understand it enough to adapt it.

I have found that echo common::Link($parent_title,$parent_title); gives me the link I want, but of course displays 'Artist_Name' instead of 'Artist Name' and echo common::GetLabel($parent_title); displays the page label ('Artist Name') but of course isn't linked as I'd like. I can't work out how to combine them to get the result I want. Any help would be much appreciated.

Please let me know if any of this doesn't make sense and needs clarifying - I really don't know what I'm doing  and as such, don't know if I am even making my needs clear.

Edited: 6 years ago#6680

Josh S.
2K Posts
266K Downloads
16 Themes
18 Plugins

How about this:

$label = common::GetLabel($parent_title);

echo common::Link($parent_title,$label);

or there's actually a shortcut function that does this:

echo common::Link_Page($parent_title);

6 years ago#6681

daisychain
9 Posts

Thank you! Both work perfectly.

I also tried the latter by itself, as I wasn't sure exactly how much of a shortcut it was. It worked, except it linked to the site's very top page - Home. Is there any shorter way to get it to find the parent directly above it? Or is the code from the thread I linked to all necessary to include? My understanding from that thread is that it inspects the menu and determines the page's direct parent.

6 years ago#6683

Topic Closed

 

News

Typesetter 5.1
8/12/2017

Typesetter 5.0.1 is now available for download. 5.1 includes bug fixes, UI/UX improvements, ... Read More

Over 8 Times Faster Than Wordpress
5/3/2016

We've known for a long time that Typesetter is fast. It's something we take pride ... Read More

More News

creisi productions

Dienstleistungen von creisi productions, Luzern (Schweiz): * Konzeption, Planung und Erstellung Ihres Internet-Auftritts * Betreuung und Aktualisierung/Pflege Ihrer Website * ...

Find out more about our Provider Spotlight

Log In

  Register