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('||i', ' ', preg_replace('||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?
I cannot exactly answer right now why it is that way but it is that way for years. The Zenpage theme does it this way:
image.php:
"> » [b][/b] ()
album.php:
"> » [b][/b]
There are also breadcrumbs for Zenpage plugin pages (not for news articles as they have no hierachy actually).
Yes, I saw that. Actually, functions printAlbumBreadcrumb and printParentBreadcrumb behave accordingly to what getAlbumBreadcrumb and getParentBreadcrumb return. printParentBreadcrumb disregards 'text' field completely and takes 'title' for body of the link:
$output .= ""; $output .= html_encode($breadcrumb['title']); $output .= '';
Hmm... can't say it's clearer to me.
For example, I checked out "Check deprecated function" utility. It dutifully reported that I use a number of those... very well, let's see what should we use instead. Opening default theme pages - wow, same deprecated functions all over again
Now I'm confused. I guess I'll try searching the forum again...
It is new version. However, after reading release notes properly I now see that it's not functions that are deprecated but only some parameters. I cleaned up my theme to replace truly deprecated functions, but I see now that there is nothing wrong with default theme.