getParentBreadcrumb vs. getAlbumBeadcrumb

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

  • acrylian Administrator, Developer
    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:
    `
    " 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).
  • 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 .= '
    ';
    `
  • acrylian Administrator, Developer
    Please try the 1.4.6 beta (you really should work on your theme using it by now) and if you still think something is wrong please open a ticket.
  • Thank you, will do.
  • 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...
  • acrylian Administrator, Developer
    Be sure you are on the right release version /build with the theme belonging to it. The official themes of the 1.4.6 build should not use deprecated functions. If there are some left that would be an error and worth a ticket.
  • 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.
  • acrylian Administrator, Developer
    Ok, always good to double check.
Sign In or Register to comment.