Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / How to add links to header bar without ez-pages

How to add links to header bar without ez-pages

Locked

Views: 7,186

Results 1 to 20 of 26
This thread is locked. New replies are disabled.
1 Aug 2006, 3:45 AM
#1
lextechs avatar

lextechs

Zen Follower

Join Date:
Mar 2005
Location:
Tempe, AZ
Posts:
316
Plugin Contributions:
0

How to add links to header bar without ez-pages

I saw many people asked about this and the files where archieved, i really didn't see a clear answer to their questions on how to add a link to the header bar. I may have missed this for give me. But i thought i'll explain how i did it without using ez-pages.

Two files need to be looked at includes/template/your template/tpl_header.php

in this file look for:

<table border="0" cellspacing="0" cellpadding="0" class="headerNavigation" align="center"> <tr class="headerNavigation"> <td align="left" valign="top" width="80%" class="headerNavigation"> <a href="<?php echo zen_href_link(FILENAME_DEFAULT, '', 'NONSSL'); ?>"><?php echo HEADER_TITLE_CATALOG; ?></a> | 

This should be around line 67 - 70,
right after the last " | "
add your links, which should look somthing like this:

<a href="<?php echo zen_href_link(FILENAME_DEFAULT, '', 'NONSSL'); ?>"><?php echo HEADER_TITLE_CATALOG; ?></a> | 
<!--Extra links-->
<a href="<?php echo zen_href_link(FILENAME_PRODUCTS_ALL); ?>"><?php echo BOX_HEADING_PRODUCTS_ALL; ?></a> | 
<a href="<?php echo zen_href_link(FILENAME_SPECIALS); ?>"><?php echo BOX_HEADING_SPECIALS; ?></a> | 
<a href="<?php echo zen_href_link(FILENAME_PRODUCTS_NEW); ?>"><?php echo BOX_HEADING_WHATS_NEW; ?></a> | 
<a href="<?php echo zen_href_link(FILENAME_FEATURED_PRODUCTS); ?>"><?php echo BOX_HEADING_FEATURED_PRODUCTS; ?></a> | 
<a href="<?php echo zen_href_link(FILENAME_CONTACT_US); ?>"><?php echo BOX_INFORMATION_CONTACT; ?></a> | 

Now the second file should be your includes/languages/your languae/your template/english.php.

you need to make sure your heading in your english file matched the one you wish to use. In this case i use "BOX_HEADING_FEATURED_PRODUCTS" this will display the text for the heading in the english file. "Featured products"

Test it out see how the links display on your header bar you may need to adjust the table so the text align correctly.

You can see the results on my page https://www.lextechs.com

I hope this helps out and i have not stepped on anyone toes. I just thougth i'd help a bit or make it a bit easier for others to find in the further.

Thanks

Lextechs

1 Aug 2006, 3:50 AM
#2
ajeh avatar

ajeh

Oba-san

Join Date:
Sep 2003
Location:
Ohio
Posts:
62,757
Plugin Contributions:
1

Re: How to add links to header bar without ez-pages

Very helpful ... :smile:

Note: your configure.php files are setup for:
lextechs.com

Your secure certificate is issued to:
https://www.lextechs.com

Your are throwing errors because of this ... :cry:

29 Sep 2006, 7:32 PM
#3
redradar avatar

redradar

New Zenner

Join Date:
Mar 2006
Location:
San Francisco, CA
Posts:
44
Plugin Contributions:
0

Re: How to add links to header bar without ez-pages

Were these links added to Zen Cart 1.3.5? Because I don't see anything like this:

<table border="0" cellspacing="0" cellpadding="0" class="headerNavigation" align="center"> <tr class="headerNavigation"> <td align="left" valign="top" width="80%" class="headerNavigation"> <a href="<?php echo zen_href_link(FILENAME_DEFAULT, '', 'NONSSL'); ?>"><?php echo HEADER_TITLE_CATALOG; ?></a> | 

in includes/template/your template/tpl_header.php for 1.3.5.

I am trying to add a single link in the header bar called "Site Map" to link to
http://www.holymtn.com/sitemap.htm

so that our clients can access the rest of our site from the Zen Cart catalog folder without having to use their "Back" buttons. We have thousands of pages on our original site and it may take years (if ever) for us to incorporate all our content into the Zen Cart matrix. Our current plan is for the catalog only to run on Zen Cart, therefore we need a link to our original site map in the navigation bar.

30 Sep 2006, 9:10 AM
#4
polarduality avatar

polarduality

Zen Follower

Join Date:
Mar 2006
Location:
Los Angeles
Posts:
260
Plugin Contributions:
2

Re: How to add links to header bar without ez-pages

ooh i have to try this. i was trying to use an image map to add some links on the header that would change depending on the language selected. this might be my solution.

30 Sep 2006, 10:10 AM
#5
clydejones avatar

clydejones

Deceased

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

Re: How to add links to header bar without ez-pages

For v1.3.5 look in includes -> templates -> YOUR_TEMPLATE -> common -> tpl_header.php

find this code:

<div id="navMain">
    <ul class="back">
    <li><?php echo '<a href="' . zen_href_link(FILENAME_DEFAULT, '', 'NONSSL'); ?>"><?php echo HEADER_TITLE_CATALOG; ?></a></li>
<li><a href="http://www.holymtn.com/sitemap.htm">Site Map</a></li>

add your link as indicated.

30 Sep 2006, 11:12 PM
#6
polarduality avatar

polarduality

Zen Follower

Join Date:
Mar 2006
Location:
Los Angeles
Posts:
260
Plugin Contributions:
2

Re: How to add links to header bar without ez-pages

many thanks to lextechs!
I now know how to add links with php.

this was exactly what I needed and I was able to implement a nav bar under the header image with links to my MORE INFO pages!

Now I can forget about that image map I couldn't get to work. hehe

1 Oct 2006, 5:23 AM
#7
redradar avatar

redradar

New Zenner

Join Date:
Mar 2006
Location:
San Francisco, CA
Posts:
44
Plugin Contributions:
0

Re: How to add links to header bar without ez-pages

That worked beautifully, clydejones. Thank you very much!

1 Oct 2006, 7:03 AM
#8
seethrou avatar

seethrou

Totally Zenned

Join Date:
May 2004
Location:
Hong Kong
Posts:
1,156
Plugin Contributions:
0

Re: How to add links to header bar without ez-pages

As seen above use the pipeline | as separator with the code,
 | 

Suggest change it to as below, if for validation. Otherwise there will have two kinds of warnings about the pipeline and the li.
Suggested code for v1.3.5:

<li id=navMainMySeparator> & #124;</li>

Please note,
the code
& #124;
which should without any space.
I separated it for the forum show it as pipe line instead of the code.
And the html code equivalent to the pipeline display.

The added <li> ..</li> also for validation. And the added id navMainMySeparator may not needed.

Reference: 1.3.5 - Home | Login separator not visible

.

2 Oct 2006, 2:13 AM
#9
polarduality avatar

polarduality

Zen Follower

Join Date:
Mar 2006
Location:
Los Angeles
Posts:
260
Plugin Contributions:
2

Re: How to add links to header bar without ez-pages

FYI, the code on the first post is from a previous version of Zen Cart.

For the latest version you wont see the table tag.

The code below is the code for the top bar where you see HOME-LOGIN-MYACCOUNT etc etc.

<div id="navMainWrapper">

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

WOOPS! clyde already posted this. hehe.

8 Oct 2006, 5:11 PM
#10
modchipfitters_co_uk avatar

modchipfitters_co_uk

Zen Follower

Join Date:
Sep 2006
Location:
United Kingdom
Posts:
190
Plugin Contributions:
0

Re: How to add links to header bar without ez-pages

great stuff this thanks it worked a treat :thumbsup:
just 1 question though how can i center the links on the bar???

14 Oct 2006, 7:21 PM
#11
lucianman avatar

lucianman

Zen Follower

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

Re: How to add links to header bar without ez-pages

how do you centre.

14 Oct 2006, 11:00 PM
#12
seethrou avatar

seethrou

Totally Zenned

Join Date:
May 2004
Location:
Hong Kong
Posts:
1,156
Plugin Contributions:
0

Re: How to add links to header bar without ez-pages

modchipfitters.co.uk:

just 1 question though how can i center the links on the bar???
Try the followings to your stylesheet.

#navMain ul {
float: none;
}

And the followings in your stylesheet which marked with red color in below should be remove or correct it, for it is not right and will affect all other parts which also use the .back class.

/*misc*/
.back {
	float: left;
	align: center;
	}
14 Oct 2006, 11:25 PM
#13
seethrou avatar

seethrou

Totally Zenned

Join Date:
May 2004
Location:
Hong Kong
Posts:
1,156
Plugin Contributions:
0

Re: How to add links to header bar without ez-pages

lucianman:

how do you centre.
With refer to the link from your signature, the template with table in the header. It should need to modify the template file. :smile:

What ZC version and template are using?

.

15 Oct 2006, 4:00 AM
#14
modchipfitters_co_uk avatar

modchipfitters_co_uk

Zen Follower

Join Date:
Sep 2006
Location:
United Kingdom
Posts:
190
Plugin Contributions:
0

Re: How to add links to header bar without ez-pages

seethrou:

Try the followings to your stylesheet.

#navMain ul {
float: none;
}

> 
> And the followings in your stylesheet which marked with red color in below should be remove or correct it, for it is not right and will affect all other parts which also use the .back class.
> ```
/*misc*/
.back {
	float: left;
	align: center;
	}

THANKYOU THATS JUST WHAT I WAS LOOKING FOR

10 Nov 2006, 9:48 PM
#15
lextechs avatar

lextechs

Zen Follower

Join Date:
Mar 2005
Location:
Tempe, AZ
Posts:
316
Plugin Contributions:
0

Re: How to add links to header bar without ez-pages

Ajeh:

Very helpful ... :smile:

Note: your configure.php files are setup for:
lextechs.com

Your secure certificate is issued to:
https://www.lextechs.com

Your are throwing errors because of this ... :cry:

Thanks how do i fix that Ajeh

10 Nov 2006, 10:03 PM
#16
lextechs avatar

lextechs

Zen Follower

Join Date:
Mar 2005
Location:
Tempe, AZ
Posts:
316
Plugin Contributions:
0

Re: How to add links to header bar without ez-pages

lextechs:

Thanks how do i fix that Ajeh
Sorry about that i figured it out just had to change the config to add the www

11 Dec 2006, 3:58 PM
#17
bbai2005 avatar

bbai2005

New Zenner

Join Date:
Dec 2006
Posts:
12
Plugin Contributions:
0

Re: How to add links to header bar without ez-pages

just a quick question:

how to rename 'Home' e.g. 'Shop', and move to the middle of the header menu list?

11 Dec 2006, 4:38 PM
#18
bbai2005 avatar

bbai2005

New Zenner

Join Date:
Dec 2006
Posts:
12
Plugin Contributions:
0

Re: How to add links to header bar without ez-pages

bbai2005:

just a quick question:

how to rename 'Home' e.g. 'Shop', and move to the middle of the header menu list?
i got the first done:
in my custom language folder 'includes\languages\english\custom\header.php'

define('HEADER_TITLE_CATALOG', 'Shop');

and second:
in 'includes\templates\custom\common\tpl_header.php'

put the

<li>your link</li> <li><?php echo '<a href="' . HTTP_SERVER . DIR_WS_CATALOG . '">'; ?><?php echo HEADER_TITLE_CATALOG; ?></a></li> <li>your link</li>
25 May 2007, 6:38 PM
#19
tatiana77 avatar

tatiana77

Zen Follower

Join Date:
May 2007
Posts:
114
Plugin Contributions:
0

Re: How to add links to header bar without ez-pages

Question,

I tried to add an "About Us" link on the header, here's what I've done, please let me know why it's not working, as I get a "Page not found" "**Custom 404 Error Page with Site Map Sample Text ..." **message when I click on the link.

**1A) I added the following string in tpl_header.php

<?php if (DEFINE_ABOUT_US_STATUS <= 1) { ?>
<li><?php echo '<a href="' . zen_href_link(FILENAME_ABOUT_US, '', 'NONSSL') . '">' . BOX_ABOUT_US . '</a>'; ?></li>
<?php } ?>

1B) Uploaded it to includes/templates/WR/common/
**
**2A) Added the following to includes/languages/english.php:

define('BOX_ABOUT_US', 'About Us');

2B) Uploaded it to includes/languages/WR

3A) Created the following file:
define_about_us.php, which simply contains:

<p><strong>About Wolf + Rabbit</strong></p> <p>testing 123</p>

3B) Uploaded it to:
includes/languages/english/html_includes/

and just in case:
****includes/languages/english/html_includes/WR

Any idea??

Thanks in advance,
Tatiana
**

25 May 2007, 7:19 PM
#20
tatiana77 avatar

tatiana77

Zen Follower

Join Date:
May 2007
Posts:
114
Plugin Contributions:
0

Re: How to add links to header bar without ez-pages

Okay I also created/uploaded the following:

includes/language/english/about_us.php

Which contains:

<?php define('HEADING_TITLE', 'About Us'); define('NAVBAR_TITLE', 'About Us'); ?>

Ppppppphhhhh DUNNO.

Tat