Member
Member
darkufo   17-01-2012, 13:30
#1

Ok.

I have an album eg this one.

http://www.spoilertv.co.uk/images/30-rock/season-1/cast-promotional-photos/

Now at the top you can see the Album and breadcrumbs.

ie this

SpoilerTV | Photo Archive | 30 Rock | Season 1 | Cast Promotional Photos

This is all great and working dandy

However if you look at my tag the Page title is

Photo Archive | Cast Promotional Photos

I'm trying to set the Title Tag to be the same as this

SpoilerTV | Photo Archive | 30 Rock | Season 1 | Cast Promotional Photos

However when I try it appears to be inserting html/link.

It seems that provides all the link/html.

Is there a similar function that will just get the text of the breadcrumb etc

Any help/advice/links most appreciated.

Administrator
Administrator
acrylian   17-01-2012, 14:12
#2

No, sorry, there is no direct simple function for that. The easiest would be to make a custom function out of that one without the html tags.

Perhaps we should have indeed a "get" variant for this. Best you open a ticket for that so we don't forget.

Member
Member
darkufo   17-01-2012, 14:15
#3

Thanks Acrylian.

Where would I find the printParentBreadcrumb function. Which file would it be in?

Member
Member
darkufo   17-01-2012, 14:20
#4

It's ok found it

Member
Member
gjr   17-01-2012, 14:28
#5

I use the following function in a few of my themes to get the album/image parent breadcrumb. I would call this in the title tag on album.php and image.php, along with the rest of the title info.
// Sets expanded titles (breadcrumbs) for Title meta function getTitleBreadcrumb($before = ' ( ', $between=' | ', $after = ' ) ') { global $_zp_gallery, $_zp_current_search, $_zp_current_album, $_zp_last_album; $titlebreadcrumb = ''; if (in_context(ZP_SEARCH_LINKED)) { $dynamic_album = $_zp_current_search->dynalbumname; if (empty($dynamic_album)) { $titlebreadcrumb .= $before.gettext("Search Result").$after; if (is_null($_zp_current_album)) { return; } else { $parents = getParentAlbums(); } } else { $album = new Album($_zp_gallery, $dynamic_album); $parents = getParentAlbums($album); if (in_context(ZP_ALBUM_LINKED)) { array_push($parents, $album); } } } else { $parents = getParentAlbums(); } $n = count($parents); if ($n > 0) { $titlebreadcrumb .= $before; $i = 0; foreach($parents as $parent) { if ($i > 0) $titlebreadcrumb .= $between; $titlebreadcrumb .= $parent->getTitle(); $i++; } $titlebreadcrumb .= $after; } return $titlebreadcrumb; }

Member
Member
darkufo   17-01-2012, 14:30
#6

Awesome, I'll give that a go

Member
Member
darkufo   17-01-2012, 14:37
#7

gjr You are a SUPERSTAR!

Thank you SO much!

Administrator
Administrator
acrylian   17-01-2012, 15:16
#8

Yep, that is what I was suggesting. I guess we should have that on board... Not sure why we don't have the usual get/print pair of functions here at all.

Member
Member
pvankempen   27-01-2013, 20:17
#9

Several months ago, we started with the zpmasonry theme and customized / expanded it for our needs. One zpmasonry function that we kept (in our theme's functions.php) is getTitleBreadcrumb. It is exactly the same (character for character) as above (gjr's posting from a year ago).

Our site was working fine until we just now upgraded to 1.4.4. Now it causes an error when we try to view an image in a dynamic album: "Fatal error: Cannot access protected property SearchEngine::$dynalbumname in ...".

Did 1.4.4 modify property dynalbumname?

Any suggestions on how to re-write function getTitleBreadcrumb?

Member
Member
gjr   27-01-2013, 21:08
#10

Try replacing:

$_zp_current_search->dynalbumname;

with:

$_zp_current_search->getDynamicAlbum();

Member
Member
pvankempen   27-01-2013, 21:44
#11

Thanks gjr - that almost did it. That gets the album, but not its name. This actually fixed it:

$_zp_current_search->getDynamicAlbum()->AlbumName

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