Forums / Templates, Stylesheets, Page Layout / adding my homepage link to the start of store breadcrumb.

adding my homepage link to the start of store breadcrumb.

Locked

Started by fl33140 on 28 Mar 2007, 6:19 PM · Views: 2,566

Results 1 to 10 of 10
This thread is locked. New replies are disabled.
28 Mar 2007, 6:19 PM
#1
fl33140 avatar

fl33140

New Zenner

Join Date:
Mar 2007
Posts:
40
Plugin Contributions:
0

adding my homepage link to the start of store breadcrumb.

I want to add my main homepage link to the beginning of the store breadcrumb. I saw in the other posts how to change the reference to 'Home' in the language files to 'storefront'. The question is how can I add my homepage link to the beginning of the breadcrumb. I would think since many people use Zen Cart as their store only, this option would make sense. I looked at the class file breadcrumb.php, is this the place make modification? and If so well, how do I do this. Thanks!

28 Mar 2007, 7:00 PM
#2
afo avatar

afo

Totally Zenned

Join Date:
Aug 2004
Location:
New York City
Posts:
6,800
Plugin Contributions:
0

Re: adding my homepage link to the start of store breadcrumb.

I don't know about adding it to the breadcrumbs, but I can tell you how to add it to the top of the page.

You can add it in includes/templates/YOUR_TEMPLATE/common/tpl_header.php. Add the line in red

<div id="headerWrapper">
<!--bof-navigation display-->
<div id="navMainWrapper">
<div id="navMain">
    <ul class="back">
    <li><a href="http://www.yourdomain.com/whatever.html">Whatever</a></li>
    <li><?php echo '<a href="' . HTTP_SERVER . DIR_WS_CATALOG . '">'; ?>
<?php echo HEADER_TITLE_CATALOG; ?></a></li>

Mary Ellen
I came; I saw; I Zenned
Taking over the world... one website at a time
Make sure brain is engaged before putting mouth in gear... or fingers to keyboard.

Holzheimer
Fan Odyssey

28 Mar 2007, 8:55 PM
#3
fl33140 avatar

fl33140

New Zenner

Join Date:
Mar 2007
Posts:
40
Plugin Contributions:
0

Re: adding my homepage link to the start of store breadcrumb.

Thanks! but I want to get the breadcrumb modified.

29 Mar 2007, 4:34 AM
#4
usernamenone avatar

usernamenone

Totally Zenned

Join Date:
Sep 2006
Posts:
541
Plugin Contributions:
0

Re: adding my homepage link to the start of store breadcrumb.

Open catalog/includes/templates/Your template/common/tpl_box_header.php

Look for <!--bof-navigation display-->

<div id="navMainWrapper"> <div id="navMain"> <ul class="back"> And add your home page link as the first <li> highlited in red below. It must be in possition #1 or #1 <!--bof-navigation display--> <div id="navMainWrapper"> <div id="navMain"> <ul class="back"> <li><a href="http://www.yoursite.com">Home Page</a> </li> <li><?php echo '<a href="' . HTTP_SERVER . DIR_WS_CATALOG . '">'; ?><?php echo HEADER_TITLE_CATALOG; ?></a></li> <?php if ($_SESSION['customer_id']) { ?> <li><a href="<?php echo zen_href_link(FILENAME_LOGOFF, '', 'SSL'); ?>"><?php echo HEADER_TITLE_LOGOFF; ?></a></li> <li><a href="<?php echo zen_href_link(FILENAME_ACCOUNT, '', 'SSL'); ?>"><?php echo HEADER_TITLE_MY_ACCOUNT; ?></a></li>

Play with it long enough and you will break it.
29 Mar 2007, 3:50 PM
#5
gjh42 avatar

gjh42

Black Belt

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

Re: adding my homepage link to the start of store breadcrumb.

Um sorry, that's the header navbar, not the breadcrumbs.

The breadcrumbs are output by tpl_main_page.php:```php

<!-- bof breadcrumb --> <?php if (DEFINE_BREADCRUMB_STATUS == '1' || (DEFINE_BREADCRUMB_STATUS == '2' && !$this_is_home_page) ) { ?>
<div id="navBreadCrumb"><?php echo $breadcrumb->trail(BREAD_CRUMBS_SEPARATOR); ?></div>
<?php } ?> <!-- eof breadcrumb -->
You could find where $breadcrumb is built and modify that, but it would probably be easier to add your homepage link to the echo statement before $breadcrumb.
29 Mar 2007, 10:43 PM
#6
fl33140 avatar

fl33140

New Zenner

Join Date:
Mar 2007
Posts:
40
Plugin Contributions:
0

Re: adding my homepage link to the start of store breadcrumb.

Thanks for all of your suggestions! it worked out. I had looked at the breadcrumb area in "tpl_main_page.php", but I had never thought of the simplicity of echoing my homepage link before the breadcrumb. Thanks for that **gjh42! **I combined this with afo's suggestion from another thread to change 'HEADER_TITLE_CATALOG' to whatever I call my store.

Here is how it worked out:

I have in "includes/header.php" on line 16:

define('HEADER_TITLE_CATALOG', 'Registration');

The breadcrumb section in my override "tpl_main_page.php":

 
<!-- bof  breadcrumb -->
<?php if (DEFINE_BREADCRUMB_STATUS == '1' || (DEFINE_BREADCRUMB_STATUS == '2' && !$this_is_home_page) ) { ?>
    <div id="navBreadCrumb">
 <?php 
 if (!$this_is_home_page) {echo '<a href="../index.html">Home</a>' . BREAD_CRUMBS_SEPARATOR . $breadcrumb->trail(BREAD_CRUMBS_SEPARATOR); } else { echo '<a href="../index.html">Home</a>' . BREAD_CRUMBS_SEPARATOR . HEADER_TITLE_CATALOG; }
 ?>
 
 </div>
<?php } ?>
<!-- eof breadcrumb -->

Thanks again!

21 Nov 2007, 6:22 PM
#7
jasperguy avatar

jasperguy

New Zenner

Join Date:
Nov 2007
Posts:
21
Plugin Contributions:
0

Re: adding my homepage link to the start of store breadcrumb.

afo:

I don't know about adding it to the breadcrumbs, but I can tell you how to add it to the top of the page.

You can add it in includes/templates/template_default/common/tpl_header.php. Add the line in red

<div id="headerWrapper"> <!--bof-navigation display--> <div id="navMainWrapper"> <div id="navMain"> <ul class="back"> <li><a href="http://www.yourdomain.com/whatever.html">Whatever</a></li> <li><?php echo '<a href="' . HTTP_SERVER . DIR_WS_CATALOG . '">'; ?> <?php echo HEADER_TITLE_CATALOG; ?></a></li> ```

Thanks AFO this worked.

My Zen Cart==
Version: 1.3.7.1

21 Nov 2007, 7:22 PM
#8
afo avatar

afo

Totally Zenned

Join Date:
Aug 2004
Location:
New York City
Posts:
6,800
Plugin Contributions:
0

Re: adding my homepage link to the start of store breadcrumb.

jasperguy:

Thanks AFO this worked.

If you changed it in template_default, your change will be lost with the next upgrade/update. You have to make the change in your custom template folder as I originally posted, not in classic or template_default.

Mary Ellen
I came; I saw; I Zenned
Taking over the world... one website at a time
Make sure brain is engaged before putting mouth in gear... or fingers to keyboard.

Holzheimer
Fan Odyssey

21 Nov 2007, 7:51 PM
#9
jasperguy avatar

jasperguy

New Zenner

Join Date:
Nov 2007
Posts:
21
Plugin Contributions:
0

Re: adding my homepage link to the start of store breadcrumb.

I have now create this includes/templates/jolly_template/common/tpl_header.php

My Zen Cart==
Version: 1.3.7.1

21 Nov 2007, 7:55 PM
#10
afo avatar

afo

Totally Zenned

Join Date:
Aug 2004
Location:
New York City
Posts:
6,800
Plugin Contributions:
0

Re: adding my homepage link to the start of store breadcrumb.

:thumbsup: Great!

Mary Ellen
I came; I saw; I Zenned
Taking over the world... one website at a time
Make sure brain is engaged before putting mouth in gear... or fingers to keyboard.

Holzheimer
Fan Odyssey