Note: the better way to avoid this problem is to not use the blog module. Blog module is intended for a site with multiple blogs. For single-user blogs, using story or a custom content type is sufficient.

I'm the only one blogging at my website, so at my site the "blogs » user's blog" part of the breadcrumb is redundant (and a bit confusing).

To remove it, I've added this to template.php:

/**
 * Remove links to individual blog from breadcrumbs.
 *
 * (This is an ugly solution, prone to break since it identifies blog nodes by matching a string in 
 * the breadcrumb. Better would be to check if node type is 'blog' But I don't know how to get that info here.
 *
 * Also note that it does not change the menu, so "my blog" is still present there. (I suspect that 'menu_set_location'
 * (as used in blog.module blog_view) may be the function to use to change this.))
 */
function phptemplate_breadcrumb() {
	$breadcrumb = drupal_get_breadcrumb();
	if ($breadcrumb[1] == l('blogs',t('blog'))){ 	    // For blog nodes... 
        unset($breadcrumb[2]);				     // ...remove "user's blog"... 							
		unset($breadcrumb[1]);     		     // ...and "blogs".
	}
	// Now call the original theme with this modified breadcrumb array, to get formatting.
   return (theme_breadcrumb($breadcrumb));
}

Comments

Anonymous’s picture

For Drupal 6 the function could look like this:

/**
 * Return a themed breadcrumb trail.
 *
 * @param $breadcrumb
 *   An array containing the breadcrumb links.
 * @return a string containing the breadcrumb output.
 */
function phptemplate_breadcrumb($breadcrumb) {
  if (!empty($breadcrumb)) {
    if ($breadcrumb[1] == l('Blogs',t('blog'))){  // For blog nodes... 
      unset($breadcrumb[2]);                      // ...remove "user's blog"...                             
      unset($breadcrumb[1]);                      // ...and "blogs".
    }
    // Now call the original theme with this modified breadcrumb array, to get formatting.
    return '<div class="breadcrumb">'. implode(' › ', $breadcrumb) .'</div>';
  }
}

--
aarakast.de

Mobile Michael’s picture

aarakast, thanks a lot. You saved my day.

I ran into the same issue with the trilingual website www.ArtAndAid.org. The above solution worked fine for English, but not for German. After I changed the 2nd if-statement to

if ($breadcrumb[1] == l(t('Blogs'), 'blog')){

it now seems to work fine for all languages. So the complete function in template.php now looks like this:

function phptemplate_breadcrumb($breadcrumb) {

  if (!empty($breadcrumb)) {
    if ($breadcrumb[1] == l(t('Blogs'), 'blog')){  		  // For blog nodes... 
      unset($breadcrumb[2]);                      // ...remove "user's blog"...                             
      unset($breadcrumb[1]);                      // ...and "blogs".
      
    }
    // Now call the original theme with this modified breadcrumb array, to get formatting.
    return '<div class="breadcrumb">'. implode(' › ', $breadcrumb) .'</div>';
  }
}
spiffyd’s picture

Just use the Custom Breadcrumbs module!

http://drupal.org/project/custom_breadcrumbs

px’s picture

For Drupal 6.x you can use this module to remove breadcrumbs from public pages. You still get to keep them for administrative pages and forums.

scrego’s picture

I've been looking for this for days! This module got rid of that pesky little "create content" link, i.e., breadcrumb that was causing me such a pain. Although disabling breadcrumbs altogether actually removes the "home" breadcrumb from every page as well--which I didn't mind at all--at least now it looks cleaner and more professional. Again, thank you so much PX!