Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / breadcrumb change-simple but frustrating!

breadcrumb change-simple but frustrating!

Locked

Views: 3,807

Results 1 to 9 of 9
This thread is locked. New replies are disabled.
3 Mar 2008, 5:45 PM
#1
knottybynature avatar

knottybynature

New Zenner

Join Date:
Jul 2007
Location:
Western New York
Posts:
48
Plugin Contributions:
0

breadcrumb change-simple but frustrating!

Hi all,

I have an INDEX page

http://www.knottybynature-ny.com

and I have a MAIN STORE PAGE

http://knottybynature-ny.com/index.php?main_page=

I have changed the header so it has 2 links: one to the "main" (index) page, one to the "shop home" (main store page).

What I can't seem to change is the navigational breadcrumb "home" link, which is also in my footer. I would like this link to take my customers to the MAIN STORE PAGE. I know I have to go to includes/classes/breadcrumb.php for the change, but I don't know exactly WHAT I'm changing, and to what do I change it?

Your help is greatly appreciated!!

Cat

6 Mar 2008, 3:56 PM
#2
knottybynature avatar

knottybynature

New Zenner

Join Date:
Jul 2007
Location:
Western New York
Posts:
48
Plugin Contributions:
0

Re: breadcrumb change-simple but frustrating!

Solved it.

in breadcrumbs.php, i changed this area:

// this line simply sets the "Home" link to be the domain/url, not main_page=index?blahblah:
if ($this->_trail[$i]['title'] == HEADER_TITLE_CATALOG) {
$trail_string .= ' <a href="http://www.knottybynature-ny.com/index.php?main_page=">**' . $this->_trail[$i]['title'] . '</a>';

i hope this helps someone else. this did not change my "shop home" link in the footer, but I think that's in english.php :D

18 Aug 2009, 2:08 PM
#3
divavocals avatar

divavocals

Totally Zenned

Join Date:
Jan 2007
Location:
Los Angeles, California, United States
Posts:
10,011
Plugin Contributions:
3

Re: breadcrumb change-simple but frustrating!

Took me a minute to figure the above.. Thought I'd clarify for others.. Replace the section in red with the URL you want to point the "Home" breadcrumb to:

// this line simply sets the "Home" link to be the domain/url, not main_page=index?blahblah:
if ($this->_trail[$i]['title'] == HEADER_TITLE_CATALOG) {
$trail_string .= '  <a href="'[B] . HTTP_SERVER . DIR_WS_CATALOG . [/B]'">' . $this->_trail[$i]['title'] . '</a>';
29 Sep 2009, 11:35 PM
#4
chaotickitty avatar

chaotickitty

New Zenner

Join Date:
Aug 2009
Location:
Toronto, ON (Canada)
Posts:
4
Plugin Contributions:
0

Re: breadcrumb change-simple but frustrating!

knottybynature:

Solved it.

in breadcrumbs.php, i changed this area:

// this line simply sets the "Home" link to be the domain/url, not main_page=index?blahblah:
if ($this->_trail[$i]['title'] == HEADER_TITLE_CATALOG) {
$trail_string .= ' <a href="http://www.knottybynature-ny.com/index.php?main_page=">**' . $this->_trail[$i]['title'] . '</a>';

i hope this helps someone else. this did not change my "shop home" link in the footer, but I think that's in english.php :D

Hi.... where exactly is the breadcrumbs.php file? :blink:

29 Sep 2009, 11:36 PM
#5
divavocals avatar

divavocals

Totally Zenned

Join Date:
Jan 2007
Location:
Los Angeles, California, United States
Posts:
10,011
Plugin Contributions:
3

Re: breadcrumb change-simple but frustrating!

ChaoticKitty:

Hi.... where exactly is the breadcrumbs.php file? :blink:Location is given in the very first post of this thread.. :smile:

29 Sep 2009, 11:46 PM
#6
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,876
Plugin Contributions:
8

Re: breadcrumb change-simple but frustrating!

If you want to link to the base URL (www .mysite .com), just remove the
. DIR_WS_CATALOG```php
// this line simply sets the "Home" link to be the domain/url, not main_page=index?blahblah:
if ($this->_trail[$i]['title'] == HEADER_TITLE_CATALOG) {
$trail_string .= ' <a href="' . HTTP_SERVER . '">' . $this->_trail[$i]['title'] . '</a>';

30 Sep 2009, 12:27 AM
#7
divavocals avatar

divavocals

Totally Zenned

Join Date:
Jan 2007
Location:
Los Angeles, California, United States
Posts:
10,011
Plugin Contributions:
3

Re: breadcrumb change-simple but frustrating!

gjh42:

If you want to link to the base URL (www .mysite .com), just remove the
. DIR_WS_CATALOG```php
// this line simply sets the "Home" link to be the domain/url, not main_page=index?blahblah:
if ($this->_trail[$i]['title'] == HEADER_TITLE_CATALOG) {
$trail_string .= ' <a href="' . HTTP_SERVER . '">' . $this->_trail[$i]['title'] . '</a>';

 
Okay Glenn.. I get this.. 
 
So pardon me for being dense and asking a dumb question.. 
 
If I want my home breadcrumb to point to 
<http://www.mydomain.com/my_home_page>
 
Could I do this? (and PLEASE don't laugh if this is wrong.. :smile:)
```php
 
// this line simply sets the "Home" link to be the domain/url, not main_page=index?blahblah:
if ($this->_trail[$i]['title'] == HEADER_TITLE_CATALOG) {
$trail_string .= '  <a href="' . HTTP_SERVER . my_home_page '">' . $this->_trail[$i]['title'] . '</a>';
30 Sep 2009, 3:40 AM
#8
divavocals avatar

divavocals

Totally Zenned

Join Date:
Jan 2007
Location:
Los Angeles, California, United States
Posts:
10,011
Plugin Contributions:
3

Re: breadcrumb change-simple but frustrating!

deleted

30 Sep 2009, 3:49 AM
#9
divavocals avatar

divavocals

Totally Zenned

Join Date:
Jan 2007
Location:
Los Angeles, California, United States
Posts:
10,011
Plugin Contributions:
3

Re: breadcrumb change-simple but frustrating!

So I get it now.. (which is why I'm responding to my own post.. :laugh:)

If you want to point your "Home" breadcrumb link to a different ZEN CART page other than the main Zen Cart page, for example:
Main Zen Cart Page: http://www.yourdomain.com/
Other Zen Cart Page to link the "Home" breadcrumb to: http://www.yourdomain.com/store_main
(In this example I am using a Zen Cart SEO add-on so the URL is a "friendly" Zen Cart URL)

Starting at around line 55 find the code highlighted in red

 
 // this line simply sets the "Home" link to be the domain/url, not main_page=index?blahblah:
 if ($this->_trail[$i]['title'] == HEADER_TITLE_CATALOG) {
 $trail_string .= '  <a href="' . HTTP_SERVER . DIR_WS_CATALOG . '">' . $this->_trail[$i]['title'] . '</a>';
 
```Change as shown below (note the new path highlighted in blue added):

// this line simply sets the "Home" link to be the domain/url, not main_page=index?blahblah:
if ($this->_trail[$i]['title'] == HEADER_TITLE_CATALOG) {
$trail_string .= ' <a href="' . HTTP_SERVER . DIR_WS_CATALOG . '[B]store_main[/B]">' . $this->_trail[$i]['title'] . '</a>';

<http://www.yourdomain.com/index.php?main_page=page&id=3>

// this line simply sets the "Home" link to be the domain/url, not main_page=index?blahblah:
if ($this->_trail[$i]['title'] == HEADER_TITLE_CATALOG) {
$trail_string .= ' <a href="' . HTTP_SERVER . DIR_WS_CATALOG . '[B]index.php?main_page=page&id=3[/B]">' . $this->_trail[$i]['title'] . '</a>';


Just so it's clear ('cause I sure needed to get it straight in my head:laugh:), the change Glenn posted is how you would modify the breadcrumb file if you had both a Zen Cart store and a separate main site. 
For example:
Main Site Home Page: [http://www.yourdomain.com](http://www.yourdomain.com/)
Store Main/Home Page: <http://www.yourdomain.com/store>

In this case you might want your store's "Home" breadcrumb  link to point to the main site versus the Zen Cart main page..

Piggybacking on Glenn's post:
> **gjh42:**
>
> If you want to link to the base URL (www .mysite .com), just remove the 
> . DIR_WS_CATALOG```php
// this line simply sets the "Home" link to be the domain/url, not main_page=index?blahblah:
if ($this->_trail[$i]['title'] == HEADER_TITLE_CATALOG) {
$trail_string .= '  <a href="' . HTTP_SERVER . '">' . $this->_trail[$i]['title'] . '</a>';

If you wanted to point your Zen Cart store's "Home" breadcrumb link to another page within your main site for example:
Main Site Home Page: http://www.yourdomain.com
Other Main Site Page to link the "Home" breadcrumb to: http://www.yourdomain.com/other_page.html

 
// this line simply sets the "Home" link to be the domain/url, not main_page=index?blahblah:
if ($this->_trail[$i]['title'] == HEADER_TITLE_CATALOG) {
$trail_string .= '  <a href="' . HTTP_SERVER . '[B]/other_page.html[/B]">' . $this->_trail[$i]['title'] . '</a>';
```Please note in this example, you MUST include the "**/**"

Alright.. done rambling now.. everyone go back to your normal programming..:laugh:







*> **DivaVocals:**
>
> Okay Glenn.. I get this.. 
> 
> So pardon me for being dense and asking a dumb question.. 
> 
> If I want my home breadcrumb to point to 
> <http://www.mydomain.com/my_home_page>
> 
> Could I do this? (and PLEASE don't laugh if this is wrong.. :smile:)
> ```php
 
// this line simply sets the "Home" link to be the domain/url, not main_page=index?blahblah:
if ($this->_trail[$i]['title'] == HEADER_TITLE_CATALOG) {
$trail_string .= '  <a href="' . HTTP_SERVER . my_home_page '">' . $this->_trail[$i]['title'] . '</a>';
```*