Zen Cart Logo
Forums / Basic Configuration / How do I change link locations for Home in header?

How do I change link locations for Home in header?

Locked

Views: 9,513

Results 1 to 16 of 16
This thread is locked. New replies are disabled.
16 Jul 2007, 12:37 AM
#1
newbie73 avatar

newbie73

New Zenner

Join Date:
Jul 2007
Posts:
8
Plugin Contributions:
0

How do I change link locations for Home in header?

I want to change the default link location for the HOME link that shows up in the header - where can I find this setting?

Thanks,

  • Luis
16 Jul 2007, 12:58 AM
#2
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: How do I change link locations for Home in header?

I want to change the default link location for the HOME link that shows up in the header - where can I find this setting?
What do you want?

The link to be directed somewhere else?

Ot the location of the link to be somewhere else on the page?

A url to you site is always helpful

Zen-Venom Get Bitten

16 Jul 2007, 1:06 AM
#3
newbie73 avatar

newbie73

New Zenner

Join Date:
Jul 2007
Posts:
8
Plugin Contributions:
0

Re: How do I change link locations for Home in header?

Currently, the link HOME -> http://www.sacota.com/shop/

I'd like HOME->http://www.sacota.com

The main site is at: http://www.sacota.com
shop is at: http://www.sacota.com/shop/

kobra:

What do you want?

The link to be directed somewhere else?

Ot the location of the link to be somewhere else on the page?

A url to you site is always helpful

16 Jul 2007, 1:22 AM
#4
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: How do I change link locations for Home in header?

Grab a copy of the includes/templates/template_default/common/tpl_header.php file to edit and when done place it in a folder at includes/templates/free_red/common/tpl_header.php

Open this file in a "plain text" editor and find the red highlighted line and replace it with your href:

<div id="navMain">
    <ul class="back">
    <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>

So it becomes:

<li><a href="http://www.sacota.com">What_you_want_as_text</a></li>

Zen-Venom Get Bitten

5 Dec 2007, 6:23 AM
#5
sparkiii avatar

sparkiii

New Zenner

Join Date:
Jun 2007
Posts:
93
Plugin Contributions:
0

Re: How do I change link locations for Home in header?

Im sorry, I cant get this to work. I am a little confused :blink:

I am in tpl_header and I replaced

<li><?php echo '<a href="' . HTTP_SERVER . DIR_WS_CATALOG . '">'; ?><?php echo HEADER_TITLE_CATALOG; ?></a></li>

with

<li><a href="http://www.medidrain.com">Home</a></li>

It doesnt work and I think I might have done something different when I first set it up.

It is the home link at the top of this page

https://www.medidrain.com/order/

Would love help:frusty:

Thanks

Nat

6 Dec 2007, 12:42 AM
#6
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: How do I change link locations for Home in header?

This is what is in your view source:

<!--bof-branding display-->
<div id="logoWrapper">
    <div id="logo"><a href="https://www.medidrain.com/order/"><img src="includes/templates/classic/images/logo.gif" alt="" width="192" height="64" /></a></div>
</div>
<br class="clearBoth" />

<!--eof-branding display-->

Did you edit a copy of this in the classic template area?

Zen-Venom Get Bitten

6 Dec 2007, 5:30 AM
#7
sparkiii avatar

sparkiii

New Zenner

Join Date:
Jun 2007
Posts:
93
Plugin Contributions:
0

Re: How do I change link locations for Home in header?

Yes I went in a saw that, but that URL does not even come up (on its own) in a search through all files in the site, thats why Im baffled. Its a really basic zencart, cut right down to minimum and I know I made a few changes of links and pages along the way, but I am baffled because, as I said, a search did not come up with that URL in my site except as shown below which are the links below that home link? :unsure:

7 Dec 2007, 2:51 AM
#8
kobra avatar

kobra

Black Belt

Join Date:
Aug 2005
Location:
Arizona
Posts:
31,500
Plugin Contributions:
4

Re: How do I change link locations for Home in header?

a search did not come up with that URL in my site
Using what search tool???

Try posting your code From the file that is between:

<!--bof-branding display-->

Your Code Here

<!--eof-branding display-->

Zen-Venom Get Bitten

7 Dec 2007, 3:24 AM
#9
sparkiii avatar

sparkiii

New Zenner

Join Date:
Jun 2007
Posts:
93
Plugin Contributions:
0

Re: How do I change link locations for Home in header?

Well thats kind of my problem, I cant find the file, I wish I knew the file and I could change it. I downloaded the whole site and I use dreamweaver so I searced the entire site using dreamweaver for that URL, and it only finds it twice (as in image supplied) and thats not to do with this home link. It doesnt come up anywhere else. It doesnt find that set of code anywhere either

 
<!--bof-branding display-->
 
<div id="logoWrapper">
<div id="logo"><a href="https://www.medidrain.com/order/"><img src="includes/templates/classic/images/logo.gif" alt="" width="192" height="64" /></a></div>
</div>
<br class="clearBoth" />
 
<!--eof-branding display-->

so I think it must be generated, BUT from where.\

I also did a search for just

<!--bof-branding display-->

and the only place it was...was

in common/tpl_header.php...this is the code between the tags;

<!--bof-branding display-->
<div id="logoWrapper">
    <div id="logo"><?php echo '<a href="' . HTTP_SERVER . DIR_WS_CATALOG . '">' . zen_image($template->get_template_dir(HEADER_LOGO_IMAGE, DIR_WS_TEMPLATE, $current_page_base,'images'). '/' . HEADER_LOGO_IMAGE, HEADER_ALT_TEXT) . '</a>'; ?></div>
<?php if (HEADER_SALES_TEXT != '' || (SHOW_BANNERS_GROUP_SET2 != '' && $banner = zen_banner_exists('dynamic', SHOW_BANNERS_GROUP_SET2))) { ?>
    <div id="taglineWrapper">
<?php
              if (HEADER_SALES_TEXT != '') {
?>
      <div id="tagline"><?php echo HEADER_SALES_TEXT;?></div>
<?php
              }
?>
<?php
              if (SHOW_BANNERS_GROUP_SET2 != '' && $banner = zen_banner_exists('dynamic', SHOW_BANNERS_GROUP_SET2)) {
                if ($banner->RecordCount() > 0) {
?>
      <div id="bannerTwo" class="banners"><?php echo zen_display_banner('static', $banner);?></div>
<?php
                }
              }
?>
    </div>
<?php } // no HEADER_SALES_TEXT or SHOW_BANNERS_GROUP_SET2 ?>
</div>
<br class="clearBoth" />
<!--eof-branding display-->

and I tried this

<!--bof-branding display-->
<div id="logoWrapper">
    <div id="logo"><?php echo '<a href="[URL="http://www.medidrain.com.au%22%3e'/"]http://www.medidrain.com.au">'[/URL] . zen_image($template->get_template_dir(HEADER_LOGO_IMAGE, DIR_WS_TEMPLATE, $current_page_base,'images'). '/' . HEADER_LOGO_IMAGE, HEADER_ALT_TEXT) . '</a>'; ?></div>
<?php if (HEADER_SALES_TEXT != '' || (SHOW_BANNERS_GROUP_SET2 != '' && $banner = zen_banner_exists('dynamic', SHOW_BANNERS_GROUP_SET2))) { ?>
    <div id="taglineWrapper">
<?php
              if (HEADER_SALES_TEXT != '') {
?>
      <div id="tagline"><?php echo HEADER_SALES_TEXT;?></div>
<?php
              }
?>
<?php
              if (SHOW_BANNERS_GROUP_SET2 != '' && $banner = zen_banner_exists('dynamic', SHOW_BANNERS_GROUP_SET2)) {
                if ($banner->RecordCount() > 0) {
?>
      <div id="bannerTwo" class="banners"><?php echo zen_display_banner('static', $banner);?></div>
<?php
                }
              }
?>
    </div>
<?php } // no HEADER_SALES_TEXT or SHOW_BANNERS_GROUP_SET2 ?>
</div>
<br class="clearBoth" />
<!--eof-branding display-->
7 Dec 2007, 3:32 AM
#10
gjh42 avatar

gjh42

Black Belt

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

Re: How do I change link locations for Home in header?

The "branding display" section deals with where clicking the logo sends you.

To change the function of the text "Home" link, make the same edit in the "navigation display" section.

Another way to do it, if you want to go to the root (https://www.domain.com) instead of say https://www.domain.com/shop, is to strip out the
. DIR_WS_CATALOG
from
<a href="' . HTTP_SERVER . DIR_WS_CATALOG . '">
leaving
<a href="' . HTTP_SERVER . '">

DIR_WS_CATALOG holds the value of "/shop" in this case.

7 Dec 2007, 10:43 PM
#11
sparkiii avatar

sparkiii

New Zenner

Join Date:
Jun 2007
Posts:
93
Plugin Contributions:
0

Re: How do I change link locations for Home in header?

Thanks gjh42...but...if you look at that page now, the link in the logo changed OK but the link in the header stayed the same but added a

/s

on the end.

 
<!--bof-branding display-->
<div id="logoWrapper">
    <div id="logo"><?php echo '<a href="' . HTTP_SERVER . '">' . zen_image($template->get_template_dir(HEADER_LOGO_IMAGE, DIR_WS_TEMPLATE, $current_page_base,'images'). '/' . HEADER_LOGO_IMAGE, HEADER_ALT_TEXT) . '</a>'; ?></div>
<?php if (HEADER_SALES_TEXT != '' || (SHOW_BANNERS_GROUP_SET2 != '' && $banner = zen_banner_exists('dynamic', SHOW_BANNERS_GROUP_SET2))) { ?>
    <div id="taglineWrapper">
<?php
              if (HEADER_SALES_TEXT != '') {
?>
      <div id="tagline"><?php echo HEADER_SALES_TEXT;?></div>
<?php
              }
?>
<?php
              if (SHOW_BANNERS_GROUP_SET2 != '' && $banner = zen_banner_exists('dynamic', SHOW_BANNERS_GROUP_SET2)) {
                if ($banner->RecordCount() > 0) {
?>
      <div id="bannerTwo" class="banners"><?php echo zen_display_banner('static', $banner);?></div>
<?php
                }
              }
?>
    </div>
<?php } // no HEADER_SALES_TEXT or SHOW_BANNERS_GROUP_SET2 ?>
</div>
<br class="clearBoth" />
<!--eof-branding display-->
8 Dec 2007, 5:35 AM
#12
sparkiii avatar

sparkiii

New Zenner

Join Date:
Jun 2007
Posts:
93
Plugin Contributions:
0

Re: How do I change link locations for Home in header?

Oh Yay Idid it.... I did it ....I did it........Thanks so much for getting me on the right direction. The link to the very top home button on the page was in the navigation area as shown below, so I tried changing it to just HTTP_SERVER and it worked, I know its not a big thing for you coders out there but Im very excited that I worked out how to do it (with help)

 
<!--bof-navigation display-->
<div id="navMainWrapper">
<div id="navMain">
    <ul class="back">
    [B]<li><?php echo '<a href="' . HTTP_SERVER . '">'; ?><?php echo HEADER_TITLE_CATALOG; ?></a></li>
[/B]<?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>
<?php
      } else {
        if (STORE_STATUS == '0') {
?>
    <li><a href="<?php echo zen_href_link(FILENAME_LOGIN, '', 'SSL'); ?>"><?php echo HEADER_TITLE_LOGIN; ?></a></li>
<?php } } ?>
<?php if ($_SESSION['cart']->count_contents() != 0) { ?>
    <li><a href="<?php echo zen_href_link(FILENAME_SHOPPING_CART, '', 'NONSSL'); ?>"><?php echo HEADER_TITLE_CART_CONTENTS; ?></a></li>
    <li><a href="<?php echo zen_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL'); ?>"><?php echo HEADER_TITLE_CHECKOUT; ?></a></li>
<?php }?>
</ul>
</div>
<div id="navMainSearch"><?php require(DIR_WS_MODULES . 'sideboxes/search_header.php'); ?></div>
<br class="clearBoth" />
</div>
<!--eof-navigation display-->
8 Dec 2007, 6:05 AM
#13
gjh42 avatar

gjh42

Black Belt

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

Re: How do I change link locations for Home in header?

Good for you!
PHP has some very scary aspects for the beginner, but a lot of it can be worked out by just following examples and thinking calmly about things.

31 Dec 2007, 3:39 AM
#14
ideashop avatar

ideashop

New Zenner

Join Date:
Sep 2007
Posts:
24
Plugin Contributions:
0

Re: How do I change link locations for Home in header?

I followed the instructions here and got my links updated. Where do I update the link for the logo on my store?

FYI: the store is here:
http://www.tlca.org/store/

31 Dec 2007, 4:09 AM
#15
gjh42 avatar

gjh42

Black Belt

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

Re: How do I change link locations for Home in header?

The same edit that works for the text "Home" link will work for the logo link.
Look at posts 9 & 10 in particular; in the "branding display" section of tpl_header.php find this```php

<div id="logo"><?php echo '<a href="' . HTTP_SERVER . DIR_WS_CATALOG . '">' . zen_image($template->get_template_dir(HEADER_LOGO_IMAGE, DIR_WS_TEMPLATE, $current_page_base,'images'). '/' . HEADER_LOGO_IMAGE, HEADER_ALT_TEXT) . '</a>'; ?></div> ```and remove the . DIR_WS_CATALOG to change it to this```php <div id="logo"><?php echo '<a href="' . HTTP_SERVER . '">' . zen_image($template->get_template_dir(HEADER_LOGO_IMAGE, DIR_WS_TEMPLATE, $current_page_base,'images'). '/' . HEADER_LOGO_IMAGE, HEADER_ALT_TEXT) . '</a>'; ?></div> ``` It appears you may have edited the text link too severely, since I see only a "/" in its address... but if that works, ok.
15 Feb 2008, 12:05 AM
#16
regz avatar

regz

New Zenner

Join Date:
Feb 2008
Posts:
1
Plugin Contributions:
0

Re: How do I change link locations for Home in header?

Thank gjh42!!!
I tried to change my logo link since few weeks ago,
and not able to get it done..

Thank to your post, it happens.
hehehee Thanks a lot!