Quantcast
Channel: Zenphoto forum
Viewing all articles
Browse latest Browse all 2917

mrskhris on "getParentBreadcrumb vs. getAlbumBeadcrumb"

$
0
0

Hello,

I'm currently working on new theme for Zenphoto. I've reached the point where I'm working on image page breadcrumbs. After checking default theme and some others I concluded that I need to use getParentBreadcrumb and getAlbumBreadcrumb functions if I want to get crumbs arrays with links, titles and texts. Said arrays then can be processed to create a breadcrumb path. "Link" is an URL, "title" is for annotating the hyperlink, and "text" will be a body of the link.

After some fiddling around I realized that whatever I try, text for album breadcrumb comes up empty. I burrowed into zp-core files, and soon found out that for some reason these two functions (getParentBreadcrumb and getAlbumBreadcrumb) have different ideas about what's what.

getParentBreadcrumb feels that title should be obtained from album description and text for album title:

$desc = strip_tags(preg_replace('|</p\s*>|i', '</p> ', preg_replace('|<br\s*/>|i', ' ', $parent->getDesc())));
$output[] = array('link' => html_encode($url), 'title' => $desc, 'text' => $parent->getTitle());

getAlbumBreadcrumb, however, feels otherwise:

$title = $album->getTitle();
[skip]
return array('link' => getAlbumLinkURL($album), 'title' => $title, 'text' => $album->getDesc());

Seems a bit illogical to me, but there must be some deep reason for this. Can anyone enlighten me?


Viewing all articles
Browse latest Browse all 2917

Trending Articles