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 1 to 20 of 80
13 Sep 2007, 11:53 AM
#1
ccaines avatar

ccaines

New Zenner

Join Date:
Jun 2005
Posts:
19
Plugin Contributions:
0

How do I change link to home?

I know this may sound like a simple question. I have looked through every option in the admin but I can't find a way to change the main url link. I originally installed zen cart in a sub directory because I planned to add other features in the root directory. Now I have my "zen-like" pages and I need to change the "home" link so the user can navigate back to those pages. Does anyone have a quick answer?

Thank you in advance.

13 Sep 2007, 12:08 PM
#2
inovermyhead avatar

inovermyhead

Zen Follower

Join Date:
Feb 2007
Posts:
154
Plugin Contributions:
0

Re: How do I change link to home?

Hi, ccaines ...
If I'm understanding what it is you're looking for, isn't that URL sepcified in the define for HTTP_SERVER in your configure.php ? At least that's where I assumed it comes from.

13 Sep 2007, 1:51 PM
#3
clydejones avatar

clydejones

Deceased

Join Date:
Nov 2005
Location:
Colorado Springs, CO USA
Posts:
7,017
Plugin Contributions:
12

Re: How do I change link to home?

ccaines:

I know this may sound like a simple question. I have looked through every option in the admin but I can't find a way to change the main url link. I originally installed zen cart in a sub directory because I planned to add other features in the root directory. Now I have my "zen-like" pages and I need to change the "home" link so the user can navigate back to those pages. Does anyone have a quick answer?

Thank you in advance.

includes/languages/english/YOUR_TEMPLATE/header.php

find:

define('HEADER_TITLE_CATALOG', 'Home');

Change the highlighted portion.

13 Sep 2007, 2:20 PM
#4
clydejones avatar

clydejones

Deceased

Join Date:
Nov 2005
Location:
Colorado Springs, CO USA
Posts:
7,017
Plugin Contributions:
12

Re: How do I change link to home?

clydejones:

includes/languages/english/YOUR_TEMPLATE/header.php

find:

define('HEADER_TITLE_CATALOG', 'Home');

Change the highlighted portion.

Sorry, I just realized I didn't answer your question.

You can add additional links to those pages by including them in:

includes/templates/YOUR_TEMPLATE/common/tpl_header.php

13 Sep 2007, 4:53 PM
#6
ccaines avatar

ccaines

New Zenner

Join Date:
Jun 2005
Posts:
19
Plugin Contributions:
0

Re: How do I change link to home?

inovermyhead:

Hi, ccaines ...
If I'm understanding what it is you're looking for, isn't that URL sepcified in the define for HTTP_SERVER in your configure.php ? At least that's where I assumed it comes from.

Ah yes. I tried it. Thanks for the tip. Unfortunately, any modification the the definition here

from

define('DIR_WS_CATALOG', '/yankeemusic/');

to

define('DIR_WS_CATALOG', '/');

effects all the defined variables in configure.php and will change the path to my template, css, images and who knows what else. Sucks for me. I think I may have to change the variable into a constant whenever DIR_WS_CATALOG is used. What do you think?

13 Sep 2007, 6:18 PM
#7
ccaines avatar

ccaines

New Zenner

Join Date:
Jun 2005
Posts:
19
Plugin Contributions:
0

Re: How do I change link to home?

I found the perfect solution.

Change the header title in includes/languages/english/YOUR TEMPLATE/header.php (i.e define('HEADER_TITLE_CATALOG', 'your new header title');)

Add a new header title (i.e define('HEADER_TITLE_HOME_PAGE', 'Home');) to replace the modified header title.

Add a new link to includes/templates/YOUR TEMPLATE/common/tpl_header.php (i.e. <li><?php echo '<a href="' . HTTP_SERVER . '">'; ?> <?php echo HEADER_TITLE_HOME_PAGE; ?></a></li>)

This new link replaces the old "Home" header title with a new defined variable modified in header.php.

Notice the href points to HTTP_SERVER.

ZEN uses HTTP_SERVER and DIR_WS_CATALOG to create the link paths. This makes it easy for anyone to modify these links in an elegant way. Just add or remove these variables as needed.

We love ZEN.

21 May 2008, 6:58 PM
#8
marypotter avatar

marypotter

New Zenner

Join Date:
May 2008
Location:
Virginia Beach, Virginia, United States
Posts:
52
Plugin Contributions:
0

Re: How do I change link to home?

I was reading through this because I was hoping it would help me and I can't figure it out.

Right now my home link goes to https://www.example.com/store. i want to send it to the main page of my site (just https://www.example.com). I can't figure out how to do that.

I know CSS and XHTML but any other language, I only have a min. knowledge of. If you someone could please break it down for me, I'd be eternally grateful.

22 May 2008, 1:14 PM
#9
marypotter avatar

marypotter

New Zenner

Join Date:
May 2008
Location:
Virginia Beach, Virginia, United States
Posts:
52
Plugin Contributions:
0

Re: How do I change link to home?

So I think I may have tried this suggestions right, but the only thing that happens is my "home" link changes to "HEADER_TITLE_HOME_PAGE" and it still links to the same place (https://www.example.com/store vs https://www.example.com).

What am I doing wrong?

22 May 2008, 4:14 PM
#10
marypotter avatar

marypotter

New Zenner

Join Date:
May 2008
Location:
Virginia Beach, Virginia, United States
Posts:
52
Plugin Contributions:
0

Re: How do I change link to home?

i figured it out. thanks anyways!

11 Jul 2008, 1:40 AM
#11
jw0847 avatar

jw0847

New Zenner

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

Re: How do I change link to home?

I am trying to do the same thing - can you explain what you did to change the link?

Thanks

21 Jul 2008, 7:12 AM
#12
htmlgoddess avatar

htmlgoddess

New Zenner

Join Date:
Jul 2008
Posts:
16
Plugin Contributions:
0

Re: How do I change link to home?

I'm also trying to figure this out. My homepage URL is different from my store URL. I would also like when people click on the logo at the top that they get sent to my main URL. How do I do this?

While I like Zen Cart so far, I don't understand why these things have to be so complicated. I wish it were easier.

21 Jul 2008, 7:35 AM
#13
kobra avatar

kobra

Black Belt

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

Re: How do I change link to home?

HTMLGoddess,

Changing it is straight html anchor code

Copy of tpl_header.php for your template

https://www.zen-cart.com/tutorials/index.php?article=36

Find this and replace with your href:

<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>

To:

<div id="logo"><?php echo '<a href="http://www.your_domain.com"> ' . zen_image($template->get_template_dir(HEADER_LOGO_IMAGE, DIR_WS_TEMPLATE, $current_page_base,'images'). '/' . HEADER_LOGO_IMAGE, HEADER_ALT_TEXT) . '</a>'; ?></div>
3 Sep 2008, 1:48 AM
#14
andrewg avatar

andrewg

New Zenner

Join Date:
Sep 2008
Posts:
3
Plugin Contributions:
0

Re: How do I change link to home?

I'm new to Zen Cart. I've found solutions to most of my questions - there is some fantastic help here. But now I'm stuck. I would like to change the home link from https://www.mydomain.com/zencart to https://www.mydomain.com

I've followed the suggestions to edit the tpl_header.php file and I've succeeded to change the link on my banner logo but I would also like to change the Home link in the header and footer of my store.

Also, while I'm at it, I'd like to add a link to the header - how do I do that?

Regards, Andrew

3 Sep 2008, 1:51 AM
#15
kobra avatar

kobra

Black Belt

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

Re: How do I change link to home?

andrewg,

Where is your site??

3 Sep 2008, 2:02 AM
#16
andrewg avatar

andrewg

New Zenner

Join Date:
Sep 2008
Posts:
3
Plugin Contributions:
0

Re: How do I change link to home?

3 Sep 2008, 2:42 AM
#18
andrewg avatar

andrewg

New Zenner

Join Date:
Sep 2008
Posts:
3
Plugin Contributions:
0

Re: How do I change link to home?

Kim:

https://www.zen-cart.com/tutorials/index.php?article=122

Hi Kim.

Thanks for the link but this deals with moving the shop to a different directory.

I am happy with the location of my shop. All I want to do is change the "Home" text link at the top and bottom of my main shop page from https://www.gyopar.com/store to https://www.gyopar.com

Andrew

3 Sep 2008, 4:41 AM
#19
gjh42 avatar

gjh42

Black Belt

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

Re: How do I change link to home?

Kobra's advice in post 13 and ccaines' description in post 7 will both do what you want.

You will have to adapt the code a bit to apply it to the footer.

Essentially, you just need to change

HTTP_SERVER . DIR_WS_CATALOG

to

HTTP_SERVER

17 Nov 2008, 8:23 PM
#20
alicia1234 avatar

alicia1234

Zen Follower

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

Re: How do I change link to home?

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.

Now, to remove 'home' from the breadcrumbs:
Go here:
http://www.zen-cart.com/forum/showthread.php?t=35299
and follow the instruction in Post #8.
NOTE that when he says upload the file to the "overrides" folder, he means that literally. There is already a folder there named "overrides". You are to put the edited file "init_add_crumbs.php" into the directory "includes/init_includes/overrides".