So I get it now.. (which is why I'm responding to my own post.. )
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
Code:
// 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):
Code:
// 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 . 'store_main">' . $this->_trail[$i]['title'] . '</a>';
Here's an example using a non SEO friendly URL (in this case an EZ Page)
http://www.yourdomain.com/index.php?main_page=page&id=3
Code:
// 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 . 'index.php?main_page=page&id=3">' . $this->_trail[$i]['title'] . '</a>';
Please note the part in blue is everything after the main path of your Zen Cart URL (do not include the "/")
Just so it's clear ('cause I sure needed to get it straight in my head), 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
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:
Originally Posted by
gjh42
If you want to link to the base URL (www .mysite .com), just remove the
. DIR_WS_CATALOG
PHP Code:
// 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
Code:
// 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 . '/other_page.html">' . $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..
Originally Posted by
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..
)
PHP Code:
// 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>';
Bookmarks