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?
Comments
image.php:
`
" title="<?php gettext('Index'); ?>"><?php echo gettext("Index"); ?> » <?php printParentBreadcrumb("", " » ", " » ");
printAlbumBreadcrumb(" ", " » "); ?>
<?php printImageTitle(); ?> (<?php echo imageNumber() . "/" . getNumImages(); ?>)
`
album.php:
`
" title="<?php echo gettext('Index'); ?>"><?php echo gettext("Index"); ?><?php printParentBreadcrumb(" » ", " » ", ""); ?> » <?php printAlbumTitle(); ?>
`
There are also breadcrumbs for Zenpage plugin pages (not for news articles as they have no hierachy actually).
`
$output .= "";
$output .= html_encode($breadcrumb['title']);
$output .= '';
`
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...