This is pretty sad design. The user should be able to specify to use whatever document fields they want for the crumbs. By defining specific fields in the code below you limit the user’s options.
Notice how alias isn’t included? What if I wanted to use the alias for crumbs instead of these given values? Well you can’t. Dumb.
// Get next crumb
$tempCrumb = $modx->getPageInfo($parent,0,"id,parent,pagetitle,longtitle,menutitle,description,published,hidemenu");
// Check for include conditions & add to crumbs
if (
$tempCrumb['published'] &&
( !$tempCrumb['hidemenu'] || !$respectHidemenu ) &&
!in_array($tempCrumb['id'],$ignoreIds)
)
{
// Add crumb
$crumbs[] = array(
'id' => $tempCrumb['id'],
'parent' => $tempCrumb['parent'],
'pagetitle' => $tempCrumb['pagetitle'],
'longtitle' => $tempCrumb['longtitle'],
'menutitle' => $tempCrumb['menutitle'],
'description' => $tempCrumb['description']);
}
To fix this bad code do the following.
// Get next crumb
$tempCrumb = $modx->getPageInfo($parent,0,"*");
// Check for include conditions & add to crumbs
if (
$tempCrumb['published'] &&
( !$tempCrumb['hidemenu'] || !$respectHidemenu ) &&
!in_array($tempCrumb['id'],$ignoreIds)
)
{
// Add crumb
$crumbs[] = $tempCrumb;
}
Also the wiki is outdated. No I’m not fixing it.
http://wiki.modxcms.com/index.php/Breadcrumbs