// you’re reading...

Tips N Tricks

Joomla: Hide breadcrumb on the Home page

Typical requirement this is. You want to display the breadcrumb on the top of every page but the home page – also called the default page or the frontpage in Joomla. This is because you don’t just want the text “HOME” hanging on the top of your Joomla’s home page.

The “Home” may be already highlighted in the main menu, visitors know that they are on the home page and the breadcrumb is not aiding any navigation. Unfortunately, the breadcrumb module (called mod_breadcrumbs) in Joomla 1.5 does not provide any option to hide it on home page and show it on other pages.If like me, you are convinced about this issue and are adamant to fix it, the solution is quite simple and requires minimal understanding of Joomla templates. Here you go:

  • Login to Joomla admin panel, goto Extensions>Module Manager
  • From the “-Select Type-” dropdown, select mod_breadcrumbs
  • Note the Position of the mod_breadcrumbs module. Typically, the position will be called “breadcrumb”. It may also be “top” or “header”. In the latter case, we may get into some trouble, as I will explain later.

Corresponding to the noted down position, you will have a tag in the file named index.php, found in <joomla-directory>/templates/<theme-name>:

<jdoc:include type=”modules” name=”breadcrumb” />

Substitute this line with the following lines:

<?php
$menu = & JSite::getMenu();
if (!($menu->getActive() === $menu->getDefault())) {
?>

<jdoc:include type=”modules” name=”breadcrumb” />

<?php
}
?>

The above lines of code shows the breadcrumb only when the page is not the default page i.e. not the home page. That’s it!

But, this works only if the breadcumb module, is the only module, published in the position. If you have other modules published in the same position, you will end up hiding all of them on the home page. Some templates include the breadcrumb module in the positions like “top” or “header” along with Main Menu module. This will hide the menu on the home page. In this case, you may seek the help of a person who understands Joomla templates and separate out the breadcrumb module to a unique position.

GD Star Rating
loading...
GD Star Rating
loading...
Joomla: Hide breadcrumb on the Home page, 7.8 out of 10 based on 4 ratings
  • Share/Bookmark

Email This Post Email This Post Print This Post Print This Post Post A Comment Post A Comment Tweet your comments/question to me @shekharg

Discussion

One comment for “Joomla: Hide breadcrumb on the Home page”

  1. thank you

    GD Star Rating
    loading...

    Posted by coba | February 24, 2010, 4:32 pm

Post a comment

shekharg: RT @aseemsood: Good news today - Delhi Metro Link between C-Sec and Qutub Minar opens today. http://bit.ly/bCXTbw
17 hours ago, comment
shekharg: I disagree, Twidroyd is the best RT @TweetDeck: New Android TweetDeck Beta is so great that we've skipped v6 & gone straight to 7!
11:05 AM Sep 02, 2010, comment
shekharg: Check out this UI http://nyti.ms/cr0Wcg
10:38 AM Sep 02, 2010, comment
shekharg: Let's declare Gurgaon a part of Pakistan till #CWG2010, to keep away the visitors from seeing the condition of roads here
9:34 AM Sep 02, 2010, comment
shekharg: RT @TechCrunch: Google Making Extraordinary Counteroffers To Stop Flow Of Employees To Facebook - http://tcrn.ch/bpdbYT by @arrington
2:18 PM Sep 01, 2010, comment