Closed (fixed)
Project:
Drupal Commons
Component:
Documentation
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
1 Sep 2010 at 04:14 UTC
Updated:
7 Feb 2011 at 17:08 UTC
This is to achieve a themed breadcrumb trail with the Acquia Drupal Common theme.
You replace the default breadcrumb function in template.php in acquia_commons theme folder in profiles/drupal_commons/theme folder:
/**
* theme_breadcrumb()
*/
function acquia_commons_breadcrumb($breadcrumb) {
if (!empty($breadcrumb)) {
return '<div class="breadcrumb">'. implode(' > ', $breadcrumb) .'</div>';
}
}
with this code:
/**
* Return a themed breadcrumb trail.
*
* @param $breadcrumb
* An array containing the breadcrumb links.
* @return a string containing the breadcrumb output.
*/
function acquia_commons_breadcrumb($breadcrumb) {
if (!empty($breadcrumb)) {
$breadcrumb[] = drupal_get_title();
array_shift($breadcrumb);
return '<div class="path"><span>'.t('You are in -> ').'</span>'. implode(' / ', $breadcrumb) .'</div>';
}
}
Note:
Of course there are dedicated contributed modules to custom breadcrumbs in theme and also this code may have to be cleaned or make it better, I'm not a coder, though.
Comments
Comment #1
mstef commentedComment #2
mstef commented