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
Views: 9,513
New Zenner
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,
Black Belt
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
New Zenner
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
Black Belt
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
New Zenner
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
Black Belt
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
New Zenner
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:
Black Belt
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
New Zenner
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-->
Black Belt
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.
New Zenner
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-->
New Zenner
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-->
Black Belt
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.
New Zenner
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/
Black Belt
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
New Zenner
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!
Tell staff why this post should be reviewed.