Member
Member
gwmbox   2010-12-19, 10:31
#1

Is there a way to print the pages parent title?

As in if the page is a sub page of another page how do I get it to print the parent title?

Cheers

GW

Member
Member
micheall   2010-12-19, 10:38
#2

You could probably do something with using the getPageParentID() function and setting of objects to extract title of the parent.

Edit:
Actually, completely forgot about this function:

printParentPagesBreadcrumb()

That does what you need.

Member
Member
gwmbox   2010-12-19, 10:51
#3

Resolved, well sort of... I have used the Custom Data field

Cheers

GW

Member
Member
gwmbox   2010-12-19, 10:53
#4

Yes but the printParentPagesBreadcrumb prints all the breadcrumbs, I only wanted one up from it

Cheers

GW

Member
Member
micheall   2010-12-19, 11:01
#5

Hmmm... wonder if you could array the output of it. The other option would be to do as I intially put and extract the title via the pageparentid.

I'll see if I can come up with something that does that for yah.

Administrator
Administrator
acrylian   2010-12-19, 11:14
#6

It helps to look at the documentation sometimes, guys! If you check this link
http://www.zenphoto.org/documentation/elementindex.html (top right on the main doc page) you can search all functions via the browser search.

So 1.3.1.2 has:
http://www.zenphoto.org/documentation/plugins/zenpage/_zp-extensions---zenpage---zenpage-functions.php.html#functiongetParentPages

In the nighty/coming 1.3.2 this usage is incorporated into the object model to be more consequent (the usage of the above is actually the same except the first line):
$parents = $pageobj->getParents(); if(is_array($parents)) { // to be sure there are parents! $directparent = $parents[0] // direct parent page titlelink $parentpage = new ZenpagePage($directparent); echo $parentpage->getTitle(); }

Member
Member
micheall   2010-12-19, 11:25
#7

I was just looking through the index right now for hints, lol. Hadn't done that in a few versions. Thanks for that acrylian.

Nice to know I was on the right path though

Member
Member
gwmbox   2010-12-19, 16:34
#8

Acrylian, please be assured I do read and 'try' to understand the documentation. While I am learning my knowledge of php is still lacking, especially when I get confused between classes and how those classes are activated within certain functions.

Most of my reaches out for help are due to my lack of being able to work it out for myself, but I do try, for quite some time too

Thanks

GW

Administrator
Administrator
acrylian   2010-12-19, 16:52
#9

Sure, just trying to motivate a little...;-)

  
Powered By MyBB, © 2002-2026 MyBB Group.
Made with by Curves UI.