Hi All,

I would like to remove the "home" link that appears on all of my pages, above my content. I would like to do this because I already have a homepage link in my navigation, so I don't need another one at the top of my page.

I believe this can be done with editing something in the template.php file, but I'm not sure how.

Thanks,

Jon

Comments

JonGirard-1’s picture

I found this little snippet of code, which seems to be doing the trick.

It won't remove home on sub pages, but for now this will work.

<?php
/*
    phptemplate_breadcrumb($breadcrumb) override
    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 = ' &raquo; ';
    // 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()) == FALSE
           
            Use: 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.
    }
}
?>

Jon.

elv’s picture

It's the right way to do it: overriding the default function with your own in template.php.

ultimateboy’s picture

The way I would do it is to go edit the theme file (page.tpl.php) and remove the breadcrumb line.

--matt

-- matt tucker

Anonymous’s picture

This is the easiest solution if you just want to remove the breadcrumbs from everything.

mndonx’s picture

Breadcrumbs should be removed from the theme configuration page rather than from the page template. If you can do something with a setting in the Drupal site, do it there first - then go to the theme files if there isn't a setting. (I realize this is an old post, but thought I'd correct that if someone happens upon it!)

JonGirard-1’s picture

Thanks for the support.

Anonymous’s picture

I was searching for this for months. luckily found this reply now and done. Short, simple and the best answer. Thanks.
You can check and confirm http://vision4life.in Home link on each page is removed and giving better view for content. webmaster@vision4life.in

ikon420’s picture

Works great thanks.