Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / How do I change link to home?

How do I change link to home?

Views: 30,492

Results 21 to 40 of 80
24 Nov 2008, 5:56 AM
#21
waytoolate avatar

waytoolate

New Zenner

Join Date:
Sep 2008
Location:
California
Posts:
40
Plugin Contributions:
0

How do I change link to home?

Mary Potter -
Can you share the exact changes you made?
I have been struggling with exactly the same issue - unsuccessfully...

Your help (or others) would be greatly appreciated.

Thanks!

24 Nov 2008, 1:00 PM
#22
alicia1234 avatar

alicia1234

Zen Follower

Join Date:
Nov 2008
Location:
Massachusetts
Posts:
164
Plugin Contributions:
0

Re: How do I change link to home?

Did you see my post #20 (one page back)? I gave the exact details of how I did it. Hope it helps.

24 Nov 2008, 4:53 PM
#23
waytoolate avatar

waytoolate

New Zenner

Join Date:
Sep 2008
Location:
California
Posts:
40
Plugin Contributions:
0

Re: How do I change link to home?

Alicia -
Thanks so much for the help.
Now, it works as I had hoped it would! :clap:

  • Way2L82W8
24 Nov 2008, 5:27 PM
#24
alicia1234 avatar

alicia1234

Zen Follower

Join Date:
Nov 2008
Location:
Massachusetts
Posts:
164
Plugin Contributions:
0

Re: How do I change link to home?

Great! Glad I could help!

28 Nov 2008, 6:04 PM
#25
nadsab avatar

nadsab

Totally Zenned

Join Date:
Sep 2004
Posts:
496
Plugin Contributions:
0

Re: How do I change link to home?

I tried the method from post # 20 in this thread and it did not work for me. Let me make sure if I got my paths correct. I copied:

includes/templates/template_default/common/tpl_header.php
includes/templates/template_default/common/tpl_footer.php

to:

/includes/templates/custom/common/tpl_header.php
/includes/templates/custom/common/tpl_footer.php

and made the above edits from previous post to the files. Are my paths correct?

28 Nov 2008, 6:13 PM
#26
alicia1234 avatar

alicia1234

Zen Follower

Join Date:
Nov 2008
Location:
Massachusetts
Posts:
164
Plugin Contributions:
0

Re: How do I change link to home?

It looks like your paths are ok, but I question why there is a slash before "includes" for your custom dirs but not for the template_default dirs. Is that significant?

For me it would be, since all of my Zen-Cart files are in a directory named /shop. That means it's at the root of my site. If I use the directory "includes", that's referring to "/shop/includes". But if I were to use "/includes", that would be at the root and would not work.

Is this the first time you are using overrides or are you already familiar with them?

28 Nov 2008, 6:23 PM
#27
nadsab avatar

nadsab

Totally Zenned

Join Date:
Sep 2004
Posts:
496
Plugin Contributions:
0

Re: How do I change link to home?

Wow thanks for the quick response alicia1234.

Actually it works for the tpl_footer.php but not for the header. My home link at bottom of page works to redirect to my home page index.html but my top home link is still re directing to the front page of ZC.

On the slash that was a typo, it should have been there for both.

Actually my full path to root web space is
/store/includes/templates/custom/common

I have some basic HTML pages at web root, ZC is located in /store, one directory up.

No I've been working with template overrides for a while now.

28 Nov 2008, 6:32 PM
#28
nadsab avatar

nadsab

Totally Zenned

Join Date:
Sep 2004
Posts:
496
Plugin Contributions:
0

Re: How do I change link to home?

Oops actually I think I mis understood. The header_tpl changes also work, the main logo is also linked to my index.html.

I was thinking that the changes would change the link of the "home" text on top of the page, which appears next to the opened category.

I guess I should delete that since I am re directing from the bottom home link to my very front page or else shoppers might get confused.

I guess that's what they call breadcrumbs.

Can that be turned off in Admin - the top breadcrumbs?

8 Dec 2008, 10:37 PM
#30
bp22 avatar

bp22

New Zenner

Join Date:
Nov 2008
Posts:
17
Plugin Contributions:
0

Re: How do I change link to home?

When I installed ZenCart, I did so in a new directory. As a result, ZenCart thinks my home page is /shop/index.php, which technically it is for our products. However, because I wanted a different entrance to the site, our actual home page is the index page when you load the domain.

So, at the top of our ZenCart store there is a "home" link. How does one go about pointing that back to https://www.domain.com rather than https://www.domain.com/shop/ ?

8 Dec 2008, 11:48 PM
#31
bigbadboy avatar

bigbadboy

Totally Zenned

Join Date:
Apr 2008
Location:
London
Posts:
557
Plugin Contributions:
0

Re: How do I change link to home?

I'm assuming you have a page called index.php that lives at root level and an index.php in the /shop/ folder.

1, BACK-UP EVERY FILE
2, Rename the main home page to home.php
3, add the following to the top of the root level htaccess file:
DirectoryIndex home.php

4, Move everything out of the /shop folder and place it at root level
5, Via your control panel access the 2 config files and change the references to root level so you'll have something like:

define('HTTP_SERVER', 'http://www.domain.com');
define('HTTPS_SERVER', 'https://www.domain.com');
define('HTTP_CATALOG_SERVER', 'http://www.domain.com');
define('HTTPS_CATALOG_SERVER', 'https://www.domain.com');

define('ENABLE_SSL_CATALOG', 'true');
define('ENABLE_SSL_ADMIN', 'true');

define('DIR_WS_ADMIN', '/admin/');
define('DIR_WS_CATALOG', '/');
define('DIR_WS_HTTPS_ADMIN', '/admin/');
define('DIR_WS_HTTPS_CATALOG', '/');

in effect taking out shop:
define('DIR_WS_CATALOG', 'shop/'); etc

Do the same with the include/admin if needed.

This will then sort out the reference problem and be better for SEs accessing the site.

9 Dec 2008, 1:48 AM
#32
mothersanddaughters avatar

mothersanddaughters

New Zenner

Join Date:
Jun 2008
Posts:
18
Plugin Contributions:
0

Re: How do I change link to home?

Ok Ive just got a quick question,

I have my zen cart linked off my home page.

Zen cart has a "Home" link up the top left hand corner of all pages next to "Login" that links back to the main zencart homepage. I would like to change it to link back to my homepage.

I cant seem to find where I can change it. :unsure:

If someone could give me a hand it would be greatly apreaciated.

Thanks

Luke

9 Dec 2008, 3:07 AM
#34
bobdog avatar

bobdog

Totally Zenned

Join Date:
Mar 2006
Location:
Fresno, California
Posts:
590
Plugin Contributions:
0

Re: How do I change link to home?

Well, a client just asked me to do this, and I found an excellent post on how to do this without messing with the configure files:

http://www.zen-cart.com/forum/showpost.php?p=643093&postcount=20

In a nutshell, here is the answer:

Make copies of these files for editing:
includes/templates/template_default/common/tpl_header
includes/templates/template_default/common/tpl_footer
(or if you've already edited them get them from your custom overrides folder)

In both files, change this:
. HTTP_SERVER . DIR_WS_CATALOG .
to this:
. HTTP_SERVER .
(pay attention to the dots!)
There is only one instance in tpl_footer; there are two in tpl_header.

9 Dec 2008, 3:07 AM
#35
mothersanddaughters avatar

mothersanddaughters

New Zenner

Join Date:
Jun 2008
Posts:
18
Plugin Contributions:
0

Re: How do I change link to home?

alicia1234:

After reading through this post and many others, I achieved what I wanted. Here's a summary so it's all in one place:

What I wanted:
"Home" in navigation bar, footer and breadcrumbs to point to https://www.mysite.com, not to https://www.mysite.com/store

Compromise:
I changed it for navigation bar and footer, but you can't change it in breadcrumbs without editing core files. So instead, I removed the 'home' link from breadcrumbs.

How to do it:
(Assumes you are familiar with the overrides system!)

Make copies of these files for editing:
includes/templates/template_default/common/tpl_header
includes/templates/template_default/common/tpl_footer
(or if you've already edited them get them from your custom overrides folder)

In both files, change this:
. HTTP_SERVER . DIR_WS_CATALOG .
to this:
. HTTP_SERVER .
(pay attention to the dots!)
There is only one instance in tpl_footer; there are two in tpl_header.

Upload the edited files to your custom overrides folder.
That takes care of navigation bar and footer.

AHHHH just worked it out didnt realise I hadnt made a common folder in my override.

9 Dec 2008, 3:13 AM
#36
mothersanddaughters avatar

mothersanddaughters

New Zenner

Join Date:
Jun 2008
Posts:
18
Plugin Contributions:
0

Re: How do I change link to home?

I figured it out cheers.:D

9 Dec 2008, 3:14 AM
#37
mothersanddaughters avatar

mothersanddaughters

New Zenner

Join Date:
Jun 2008
Posts:
18
Plugin Contributions:
0

Re: How do I change link to home?

bobdog:

Well, a client just asked me to do this, and I found an excellent post on how to do this without messing with the configure files:

http://www.zen-cart.com/forum/showpost.php?p=643093&postcount=20

In a nutshell, here is the answer:

Make copies of these files for editing:
includes/templates/template_default/common/tpl_header
includes/templates/template_default/common/tpl_footer
(or if you've already edited them get them from your custom overrides folder)

In both files, change this:
. HTTP_SERVER . DIR_WS_CATALOG .
to this:
. HTTP_SERVER .
(pay attention to the dots!)
There is only one instance in tpl_footer; there are two in tpl_header.

Yep I just used this and if worked perfectly. Your just unable to change the breadcrumbs home link, witch didnt worry me but can be removed.

9 Dec 2008, 10:51 PM
#38
biged avatar

biged

New Zenner

Join Date:
Dec 2008
Posts:
4
Plugin Contributions:
0

Re: How do I change link to home?

Ok, I followed the instructions and created a common folder inside my custom template. I made the changes to the header and footer and uploaded to the common folder. Now when I refresh the entire header and footer disappear. I removed the custom header and footer from my common folder and everything is back to normal but still not directing to the root of my website. Anyone run across this before?

Thanks in advance.

10 Dec 2008, 2:57 AM
#39
alicia1234 avatar

alicia1234

Zen Follower

Join Date:
Nov 2008
Location:
Massachusetts
Posts:
164
Plugin Contributions:
0

Re: How do I change link to home?

Can you post the contents of your customized tpl_header.php and tpl_footer.php files?

10 Dec 2008, 3:56 PM
#40
biged avatar

biged

New Zenner

Join Date:
Dec 2008
Posts:
4
Plugin Contributions:
0

Re: How do I change link to home?

This is my Header.

<?php /** * Common Template - tpl_header.php * * this file can be copied to /templates/your_template_dir/pagename<br /> * example: to override the privacy page<br /> * make a directory /templates/my_template/privacy<br /> * copy /templates/templates_defaults/common/tpl_footer.php to /templates/my_template/privacy/tpl_header.php<br /> * to override the global settings and turn off the footer un-comment the following line:<br /> * <br /> * $flag_disable_header = true;<br /> * * @package templateSystem * @copyright Copyright 2003-2006 Zen Cart Development Team * @copyright Portions Copyright 2003 osCommerce * @license <http://www.zen-cart.com/license/2_0.txt> GNU Public License V2.0 * @version $Id: tpl_header.php 4813 2006-10-23 02:13:53Z drbyte $ */ ?> <?php // Display all header alerts via messageStack: if ($messageStack->size('header') > 0) { echo $messageStack->output('header'); } if (isset($_GET['error_message']) && zen_not_null($_GET['error_message'])) { echo htmlspecialchars(urldecode($_GET['error_message'])); } if (isset($_GET['info_message']) && zen_not_null($_GET['info_message'])) { echo htmlspecialchars($_GET['info_message']); } else { } ?> <!--bof-header logo and navigation display--> <?php if (!isset($flag_disable_header) || !$flag_disable_header) { ?> <div id="headerWrapper"> <!--bof-navigation display--> <div id="navMainWrapper"> <div id="navMain">
<ul class="back">

<li><?php echo '<a href="' . HTTP_SERVER . '">'; ?><?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>
<?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--> <!--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--> <!--eof-header logo and navigation display--> <!--bof-optional categories tabs navigation display--> <?php require($template->get_template_dir('tpl_modules_categories_tabs.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_modules_categories_tabs.php'); ?> <!--eof-optional categories tabs navigation display--> <!--bof-header ezpage links--> <?php if (EZPAGES_STATUS_HEADER == '1' or (EZPAGES_STATUS_HEADER == '2' and (strstr(EXCLUDE_ADMIN_IP_FOR_MAINTENANCE, $_SERVER['REMOTE_ADDR'])))) { ?> <?php require($template->get_template_dir('tpl_ezpages_bar_header.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_ezpages_bar_header.php'); ?> <?php } ?> <!--eof-header ezpage links--> </div> <?php } ?>