i love this snippet!
i have come across a minor issue using it though, so i thought i would post how i got around it here.
this has not been tested but seems to work for me.
my problem:
i was using the default breadcrumb snippet (so the current crumb was not a link)
i found that while the previous crumbs showed up as menu titles, the current crumb was showing up as the page title. this was the case whether i used the default settings, or set a titleField parameter. whatever setting i used, the page title showed up on the home page crumb instead of the menu title.
i had a look through the snippet code and found this:
// show current page, as link or not
if ($showCurrentCrumb){
if ($currentAsLink && (!$respectHidemenu || ($respectHidemenu && $docInfo['hidemenu'] != 1 ))){
$titleToShow = ($docInfo[$titleField])? $docInfo[$titleField] : $docInfo['pagetitle'] ;
$descriptionToUse = ($docInfo[$descField]) ? $docInfo[$descField] : $docInfo['pagetitle'] ;
$ptarr[] = '<a href="[~'.$modx->documentIdentifier.'~]" title="'.$descriptionToUse.'">'.$titleToShow.'</a>';
} else {
$ptarr[] = $docInfo['pagetitle'];
}
}
i could well be completely wrong, but it seemed to me that if you do not want the current crumb to be a link, the current crumb is being set to $docInfo[’pagetitle’] in all cases??
workaround:
i modified the above branch as below, just to always use the titleToShow variable to determine the current crumb once a current crumb is to be shown (regardless of whether it should be a link or not). i am new to editing snippets, but it seems to work for me now - i am seeing menu titles everywhere!
// show current page, as link or not
if ($showCurrentCrumb){
$titleToShow = ($docInfo[$titleField])? $docInfo[$titleField] : $docInfo['pagetitle'] ;
if ($currentAsLink && (!$respectHidemenu || ($respectHidemenu && $docInfo['hidemenu'] != 1 ))){
$descriptionToUse = ($docInfo[$descField]) ? $docInfo[$descField] : $docInfo['pagetitle'] ;
$ptarr[] = '<a href="[~'.$modx->documentIdentifier.'~]" title="'.$descriptionToUse.'">'.$titleToShow.'</a>';
} else {
$ptarr[] = $titleToShow;
}
}