zzelinski | Shared With: Everyone - Aug 05 2008 | drupal
I think I faved this already...but here's the code snippet that will give you the title of the page you're on in drupal breadcrumbs when pasted into template.php in theme.
Quoted: <?php
/*
phptemplate_breadcrumb($breadcrumb) modification
File: template.php
Use: Hide breadcrumb trails with only 1 crumb, regardless of crumb name ("home" is)
a popular single-crumb that people like to have removed in some templates.
Through: PHPTemplate function override
Benefits: Does not involve extra code in separate view.
*/
function phptemplate_breadcrumb($breadcrumb) {
$home = variable_get('site_name', 'drupal');
$sep = ' » ';
// Check if breadcrumb has more than 1 element.
// Options: Change to the number of elements/crumbs a breadcrumb needs to be visible.
if (count($breadcrumb) > 1) {
$breadcrumb[0] = l(t($home), '');
/*
Optional: Include page title in breadcrumb.drupal_get_title() !== ''
Check if title blank, if that is the case, we cannot include trailing page name.
strstr(end($breadcrumb),drupal_get_title()) == FALSE
Some modules will make it so path or breadcrumb will involve duplication of
title and node name (such as in the Events module) to remove this, simply
take out && strstr(end($breadcrumb),drupal_get_title()) == FALSEUse: Simply uncomment the if structure below (3 lines).
Special Use: If you wish to use this regardless of elements/crumbs in a breadcrumb
simply cut/paste the statements inside the "if (count($breadcrumb) > 1)" outside
of the structure, and delete the extranneous structure.
*/
if ( (drupal_get_title() !== '') && (strstr(end($breadcrumb),drupal_get_title()) ) == FALSE) {
$breadcrumb[] = t(drupal_get_title(), '');
}return implode($sep, $breadcrumb);
} else {
// Would only show a single element/crumb (or none), so return nothing.
// You can remove this statement.
}
}
?>
zzelinski | Shared With: Everyone - Aug 04 2008 | drupal
zzelinski | Shared With: Everyone - Jul 29 2008 | go, drupal
zzelinski | Shared With: Everyone - Jul 09 2008 | drupal
zzelinski | Shared With: Everyone - Jul 03 2008 | drupal, upgrade
zzelinski | Shared With: Everyone - Jun 30 2008 | drupal, video
zzelinski | Shared With: Everyone - Jun 27 2008 | drupal, media
zzelinski | Shared With: Everyone - Jun 27 2008 | video, drupal
zzelinski | Shared With: Everyone - Jun 27 2008 | drupal
zzelinski | Shared With: Everyone - Jun 25 2008 | drupal, monitor, modules
Related Content from Around Faves
drupal
- 1 FaverViewed: 2 Times
- mike - Sep 19 20084 FaversViewed: 11 Times
- geekglue - Oct 13 20081 FaverViewed: 4 Times
video
-
2 FaversViewed: 64 TimesQuoted: English Song Slipknot - Snuff Slipknot - Snuff Lyrics :- Bury all your secrets in my skin Come away with innocence And leave me with my sins The air around me still feels like a cage And love is just a camouflage For what resembles rage again So if you love me let me go And run away before I know My heart is just too dark to care I cant
- jimbit - Sep 28 20081 FaverViewed: 29 Times
- slags - 18 days ago1 FaverViewed: 28 Times

