Zen Cart Logo
Forums / Templates, Stylesheets, Page Layout / How to move navigation bar in header?

How to move navigation bar in header?

Locked

Views: 10,031

Results 1 to 19 of 19
This thread is locked. New replies are disabled.
1 Jul 2008, 5:08 AM
#1
discguy avatar

discguy

New Zenner

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

How to move navigation bar in header?

Is there any way to move the navigation bar in the header below the logo, instead of on top of it.

1 Jul 2008, 6:39 AM
#2
discguy avatar

discguy

New Zenner

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

Re: How to move navigation bar in header?

I discovered the answer to my own question!

6 Jul 2008, 2:03 AM
#3
craft_magick avatar

craft_magick

Zen Follower

Join Date:
Nov 2007
Posts:
166
Plugin Contributions:
0

Re: How to move navigation bar in header?

discguy:

I discovered the answer to my own question!

I have been searching for the past 2 hours trying to find out how to move the nav bar below my logo image.

If you would post the solution it would be much appreciated.

Thanks much.

Zencart ROCKS!

6 Jul 2008, 2:27 AM
#4
craft_magick avatar

craft_magick

Zen Follower

Join Date:
Nov 2007
Posts:
166
Plugin Contributions:
0

Re: How to move navigation bar in header?

Craft Magick:

I have been searching for the past 2 hours trying to find out how to move the nav bar below my logo image.

If you would post the solution it would be much appreciated.

Thanks much.

Zencart ROCKS!

Just found the answer a few minutes after I posted. Here it is for anyone else frantically searching for the answer as to how to move the navigation bar with home/login links to below the logo image.

BE SURE TO MAKE A BACKUP YOUR TPL_HEADER.PHP FILE BEFORE DOING THIS!!

  1. open the file includes/templates/your_custom_template/common/tpl_header.php

  2. cut ALL of the code between the following 2 lines (be sure to leave both of these lines where they are and do NOT cut them):

<!--bof-header logo and navigation display-->

<!--bof-branding display-->
  1. paste your cut code BETWEEN these two lines
<!--eof-branding display-->

<!--eof-header logo and navigation display-->

That's it... so simple but being the NOT so php savvy person (and knowing nothing about php syntax) it took me quite a while to actually understand what code to move and where to move it to!!

Good learning experience :clap:

Zencart ROCKS!

6 Jul 2008, 2:56 AM
#5
gjh42 avatar

gjh42

Black Belt

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

Re: How to move navigation bar in header?

You got it almost right, but if I understand your directions correctly, there is a substantive error.

When you move code blocks, you should move entire blocks between and including the

<!--bof xxxx--> and <!--eof xxxx--> comments, to keep the identification correct.

You should not move the

<?php if (!isset($flag_disable_header) || !$flag_disable_header) { ?> <div id="headerWrapper">

which is between the

<!--bof-header logo and navigation display-->

and

<!--bof-navigation display-->

You should move the block

<!--bof-navigation display-->

...

<!--eof-navigation display-->

to below

<!--eof-branding display-->
6 Jul 2008, 7:30 AM
#6
craft_magick avatar

craft_magick

Zen Follower

Join Date:
Nov 2007
Posts:
166
Plugin Contributions:
0

Re: How to move navigation bar in header?

gjh42:

You got it almost right, but if I understand your directions correctly, there is a substantive error.

When you move code blocks, you should move entire blocks between and including the

<!--bof xxxx--> and <!--eof xxxx--> comments, to keep the identification correct.

You should not move the

<?php if (!isset($flag_disable_header) || !$flag_disable_header) { ?> <div id="headerWrapper">

which is between the

<!--bof-header logo and navigation display-->

and

<!--bof-navigation display-->

You should move the block

<!--bof-navigation display-->

...

<!--eof-navigation display-->

to below

<!--eof-branding display-->

I'm LOL at myself and thank you for the correction, gjh42. All I know is that whatever I did worked so I didn't want to mess with it any further :shocking:

Anyway, thanks for clearing that up.

Zencart ROCKS!

13 Jul 2010, 8:05 PM
#7
csenge avatar

csenge

New Zenner

Join Date:
Feb 2010
Posts:
30
Plugin Contributions:
0

Re: How to move navigation bar in header?

Hi,

I used the above methd and moved the nav bar but what I really want to do and cant figure out how is how to MERGE the nav bar with the categories bar? I want this order:
Home/Category1/Category2/Category3/Contact/LogIn. Anyone could help?
The webpage: http://miniatureinstruments.co.uk/ and I am using ZC 1.8
Thanks:)

14 Jul 2010, 9:59 AM
#8
csenge avatar

csenge

New Zenner

Join Date:
Feb 2010
Posts:
30
Plugin Contributions:
0

Re: How to move navigation bar in header?

No ideas?

14 Jul 2010, 2:57 PM
#9
csenge avatar

csenge

New Zenner

Join Date:
Feb 2010
Posts:
30
Plugin Contributions:
0

Re: How to move navigation bar in header?

Please, someone.

14 Jul 2010, 3:37 PM
#10
gjh42 avatar

gjh42

Black Belt

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

Re: How to move navigation bar in header?

Probably the best method would be to move the <li> elements from the navMainWrapper block in tpl_header.php to appropriate places inside the <ul> in /includes/templates/your_template/templates/tpl_modules_categories_tabs.php. (Remove the entire navMain block from tpl_header.php to avoid duplication.)

Be aware that there are several elements in navMain that only appear when you are logged in or have something in the cart. You want to allow enough space in the row for those, or else make arrangements to display them somewhere else. You also need to decide what you want to do with the search_header element.

16 Jul 2010, 2:15 PM
#11
csenge avatar

csenge

New Zenner

Join Date:
Feb 2010
Posts:
30
Plugin Contributions:
0

Re: How to move navigation bar in header?

Thanks gjh42, that sounds very complicated I dont think I could do it. But thanks anyway.

16 Jul 2010, 5:07 PM
#12
gjh42 avatar

gjh42

Black Belt

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

Re: How to move navigation bar in header?

This would be one arrangement that could work:
(/includes/templates/your_template/templates/tpl_modules_categories_tabs.php)```php

<?php /** * Module Template - categories_tabs * * Template stub used to display categories-tabs output * * @package templateSystem * @copyright Copyright 2003-2005 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_modules_categories_tabs.php 3395 2006-04-08 21:13:00Z ajeh $ modified 2010-07-16 gjh42 */ include(DIR_WS_MODULES . zen_get_module_directory(FILENAME_CATEGORIES_TABS)); ?> <?php if (CATEGORIES_TABS_STATUS == '1' && sizeof($links_list) >= 1) { ?> <div id="navCatTabsWrapper"> <div id="navCatTabs"> <ul> <li><?php echo '<a href="' . HTTP_SERVER . DIR_WS_CATALOG . '">';//line moved from tpl_header ?><?php echo HEADER_TITLE_CATALOG; ?></a></li> <?php for ($i=0, $n=sizeof($links_list); $i<$n; $i++) { ?> <li><?php echo $links_list[$i];?></li> <?php } ?> <?php if ($_SESSION['customer_id']) {//section moved from tpl_header ?> <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 } }//end section moved from tpl_header ?> </ul> </div> </div> <?php } ?> ```
17 Jul 2010, 11:06 AM
#13
csenge avatar

csenge

New Zenner

Join Date:
Feb 2010
Posts:
30
Plugin Contributions:
0

Re: How to move navigation bar in header?

Hello Glen,

I dont have the route you suggest, I have
/includes/templates/your_template/sideboxes/tpl_categories (without background for sub-cats).tpl_categories.php
or
/includes/templates/your_template/sideboxes/tpl_categories.php
Which one shuld I use or do I need to create the one that you suggest?
Thanks,

Csenge

17 Jul 2010, 11:45 AM
#14
gjh42 avatar

gjh42

Black Belt

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

Re: How to move navigation bar in header?

Save the file in exactly the path I noted (adjust "your_template" to your actual template name). The one you describe is for the categories menu in the sidebar.

17 Jul 2010, 7:04 PM
#15
csenge avatar

csenge

New Zenner

Join Date:
Feb 2010
Posts:
30
Plugin Contributions:
0

Re: How to move navigation bar in header?

Hi gjh42,

thanks, now all the categories/headings i want are in one line except Contact Us. Is there any way you could add that. And then how can i disable the original Home/Contact Us/Log in line? Sorry to be a pain.

17 Jul 2010, 9:29 PM
#16
gjh42 avatar

gjh42

Black Belt

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

Re: How to move navigation bar in header?

The standard Zen Cart header nav does not have a contact us link. You could add a line like this (alter if you know something that needs to be different) inside the <ul> list in the position you want it:```php
<li><a href="<?php echo zen_href_link(FILENAME_CONTACT_US, '', 'SSL'); ?>"><?php echo HEADER_TITLE_CONTACT_US; ?></a></li>


You can delete the entire section 
<!--bof-navigation display-->
...
<!--eof-navigation display-->
from tpl_header.php.
18 Jul 2010, 1:45 PM
#17
csenge avatar

csenge

New Zenner

Join Date:
Feb 2010
Posts:
30
Plugin Contributions:
0

Re: How to move navigation bar in header?

Thanks Glen, that works :smile: Thanks for all your help!!
Csenge

26 Jul 2010, 6:29 PM
#18
webmc avatar

webmc

New Zenner

Join Date:
Jul 2010
Location:
Kent UK
Posts:
50
Plugin Contributions:
0

Re: How to move navigation bar in header?

Is there anyway just to turn the header navigation bar off in the admin? You can do this for Categories etc - Does it pose a problem as a default setup as this is where the login menu is and therfore was not built to be turned off?

27 Jul 2010, 12:42 AM
#19
gjh42 avatar

gjh42

Black Belt

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

Re: How to move navigation bar in header?

This cannot be turned off in admin, as there are several links there that are not necessarily available anywhere else without customization.