Community Add-Ons
| Maintainers: | vampirehunter |
Different Headers/no breadcrumbs on Home Page for 2.3.2
for osCommerce Online Merchant v2.3
Different Headers/no breadcrumbs for Home Page for 2.3.2
********************************************************
This is a quick useful way of removing the breadcrumb trail from just your home page.
1.) Simply make a duplicate copy of your "header.php" file and rename it as something else.
2.) Then go to your "template_top.php" file and towards the bottom of the code.
Replace this code:
require(DIR_WS_INCLUDES . 'header.php');
and past this in: (put your duplicate header file name where in my example have put mine which is "headerhome.php")
if ( basename($PHP_SELF) == FILENAME_DEFAULT ) {
if ( $cPath!='' )
require(DIR_WS_INCLUDES . 'header.php');
else
require(DIR_WS_INCLUDES . 'headerhome.php');
}
else
require(DIR_WS_INCLUDES . 'header.php');
3.)
Now, in your duplicate header template file,
you can feel free to modify it by removing the breadcrumb link or add any other changes.
To remove the breadcrumb link in your alternate header template file.
Just find this line:
<?php echo '' . $breadcrumb->trail('»'); ?>
and delete it.
******************************
Now on your home page, you will have no breadcrumbs, whilst on the rest of the pages you will have the breadcrumbs.
Having an alternate header file means you can also modify the layout, and make any other changes required.
This is a nice easy modifcation which is very useful as a starting plan if you plan to have a home page that
Legend:
Download
Report
This will show on category and manufacturer pages, but not the home page.
No need to do any type of file switching, just add this in place of your breadcrumb code:
<?php
if ( (strpos($_SERVER['PHP_SELF'], 'index.php')) && (!isset($_GET['manufacturers_id']) && (!$current_category_id)) ) {
//we just dont display anything
} else { ?>
<div class="grid_24 ui-widget infoBoxContainer">
<div class="ui-widget-header infoBoxHeading"><?php echo ' ' . $breadcrumb->trail(' » '); ?></div>
</div>
<?php } ?>
It can be expanded. Lets say you want to exclude another page as well - here is how you would do so:
if ( ( (strpos($_SERVER['PHP_SELF'], 'index.php')) && (!isset($_GET['manufacturers_id']) && (!$current_category_id)) ) || (strpos($_SERVER['PHP_SELF'], 'file_name_to_exclude.php')) ) {
and so on and so on adding "|| (strpos($_SERVER['PHP_SELF'], 'file_name_to_exclude.php'))" for each page.
