We will be doing some site maintenance and need to take the site down for 10 minutes.

Site will go down at 19:00 UTC

Forums / Setting Up Categories, Products, Attributes / Option to show Category 0 in the breadcrumb nav bar?

Option to show Category 0 in the breadcrumb nav bar?

Started by mi16chap on 16 Apr 2012, 1:05 PM · Views: 980

Results 1 to 5 of 5
16 Apr 2012, 1:05 PM
#1
mi16chap avatar

mi16chap

New Zenner

Join Date:
Oct 2011
Location:
West Yorkshire - England
Posts:
38
Plugin Contributions:
0

Option to show Category 0 in the breadcrumb nav bar?

Hi all.

I have recently tried to redesign and clean up my site from showing all the categories on my main page, and moving the all categories thumbnails to a seperate page, which I did by providing a link to category 0 to show all categories.

http://test.italianhampers.co.uk/index.php?main_page=index&cPath=0

Now when I go into a category and item, the breadcrumb navigation bar shows something like

Home :: Chocolate :: Chocaviar (85g)

I want it to include the zero category so users can find their way back more easily...

Home :: Categories :: Chocolate :: Chocaviar (85g)

I cant find an option to do this....does anyone else know?

16 Apr 2012, 4:02 PM
#2
drbyte avatar

drbyte

Sensei

Join Date:
Jan 2004
Posts:
63,515
Plugin Contributions:
176

Re: Option to show Category 0 in the breadcrumb nav bar?

/includes/init_includes/init_add_crumbs.php (save your changed file into the "overrides" subfolder, instead of editing this file directly).
Line 15 has the following; add the next line below it, as shown:```
$breadcrumb->add(HEADER_TITLE_CATALOG, zen_href_link(FILENAME_DEFAULT));
[B]if (in_array($current_page_base, array(FILENAME_PRODUCT_INFO)) || sizeof($cPath_array) > 0) $breadcrumb->add(BOX_HEADING_CATEGORIES, zen_href_link(FILENAME_DEFAULT, 'cPath=0'));[/B]

.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole

Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

16 Apr 2012, 4:07 PM
#3
dgent avatar

dgent

Totally Zenned

Join Date:
Nov 2009
Location:
UK
Posts:
1,117
Plugin Contributions:
0

Re: Option to show Category 0 in the breadcrumb nav bar?

If you go to includes/classes/breadcrumbs.php you can change the 'home' to be any url you like. (find the switch on line 52)

What I would then do it change the word 'home' to 'Categories' in your language file...

and then go to templates/tpl_main_page.php and find this section..

<div id="navBreadCrumb"><?php echo $breadcrumb->trail(BREAD_CRUMBS_SEPARATOR); ?></div>

..and change it to

<div id="navBreadCrumb"><a href="index.php">Home ::</a><?php echo $breadcrumb->trail(BREAD_CRUMBS_SEPARATOR); ?></div>
16 Apr 2012, 7:34 PM
#5
mi16chap avatar

mi16chap

New Zenner

Join Date:
Oct 2011
Location:
West Yorkshire - England
Posts:
38
Plugin Contributions:
0

Re: Option to show Category 0 in the breadcrumb nav bar?

I used Dr Byte's suggestion, once again thankyou for both taking time to consider my problem, the community support for Zen is better than I have experienced from pro software support I have used over the years. :clap: