You could try creating a new snippet for the purposes of extending the 'Breadcrumbs' class. You could try capturing the output of Breadcrumbs->run(), and then modify it to append a custom crumb. If you just want to add 'Add Album' (or any other piece of text) as an additional crumb for the current resource then you could try something like this:
e.g: 'MyBreadcrumbs' snippet:
<?php
require_once $modx->getOption('breadcrumbs.core_path',null,$modx->getOption('core_path').'components/breadcrumbs/').'model/breadcrumbs/breadcrumbs.class.php';
class ExtendedBreadCrumbs extends BreadCrumbs {
public function run() {
$output = parent::run();
if(!empty($this->config['extra_crumb'])) {
$output = str_replace('B_lastCrumb','B_Crumb',$output);
$extra = ' '.$this->config['crumbSeparator'].' ';
$extra.= $this->getChunk('bcTplCrumbLast',array(
'text' => $this->config['extra_crumb'],
))."\n";
$output = str_replace('</ul>',$extra.'</ul>',$output);
}
return $output;
}
}
$bc = new ExtendedBreadCrumbs($modx,$scriptProperties);
return $bc->run();
You could pass the text / string in your snippet call along with all other standard 'Breadcrumbs' script properties.
e.g.
[[!MyBreadcrumbs? ¤tAsLink=`1` &extra_crumb=`Add Album`]]
Would produce something like
Home > Current Page > Add Album
?
[ed. note: spiltmilk last edited this post 14 years, 4 months ago.]