Header Nav Code Modification
Hello
I am working on my site, it is here http://www.sorce.co.uk/logo-golf-balls/
I would like all the nav links, like 'log on', 'my account', 'shopping cart', 'checkout', etc., to show, even though you may not have added anything to basket, for example.
Can anyone advise which code in tpl_header.php to alter to achieve this?
Help very much appreciated!
Re: Header Nav Code Modification
First insure that you are using the overrides, or make a copy of the tpl_header.php file in the event this does not work.
In this file, in the or under <!--bof-navigation display--> the first "if" or about 5 lines below the bof is this line:
Code:
<?php if ($_SESSION['customer_id']) { ?>
and comment this out or remove it. This should display the li's without checking if a session is active
Re: Header Nav Code Modification
Hey Kobra
Thanks for getting back to me.
I took the <?php // if ($_SESSION['customer_id']) { ?> line out from tpl_header.php, uploaded, but now shows an error page:
Parse error: parse error, unexpected '}' in c:\domains\sorce.co.uk\wwwroot\logo-golf-balls\includes\templates\arch_shoppe\common\tpl_header.php on line 114
Any ideas?
Another realted question: How do i center this header nav? I can't seem to locate the correct bit of css to do this
Re: Header Nav Code Modification
Sorry that did not work....I only "hack" at php and why I cautioned to make copies.
Centering the header nav?? We discussing the nav bar or the text contained within it?
Re: Header Nav Code Modification
Since that line of code is part of an "if/else" statement, just removing the one line will generate the error you are getting.
You'll need to change the whole section as follows:
Code:
<?php if ($_SESSION['customer_id']) { ?> /* delete this line */
<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 { /* delete this line */
if (STORE_STATUS == '0') {
?> /* delete this line */
<li><a href="<?php echo zen_href_link(FILENAME_LOGIN, '', 'SSL'); ?>"><?php echo HEADER_TITLE_LOGIN; ?></a></li>
<?php } } ?> /* delete the highlighted character */
<?php if ($_SESSION['cart']->count_contents() != 0) { ?> /* delete this line */
<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 }?> /* delete this line */
Re: Header Nav Code Modification
No worries, I am much like yourself, a bit of a hacker, but i really appreciate your input.
Its the same text links that i am trying to work with here - i am just thinking that if i CAN'T show all links (but i'm sure there must be a way somehow, there has to be!?) the links that are there would look better centre aligned.
See what i mean?
Re: Header Nav Code Modification
hey clydejones
i thought that might be the case
i will give it a go and report back
Re: Header Nav Code Modification
Thanks Clyde
That worked.
The only bit i had problems with was this bit, line 7 (before code is deleted):
Code:
?> /* delete this line */
When i uploaded the modified code, I got an error, some kind of parse problem and a mention of a missing So, i just put that bit of code back and it seems to be working, all links are now displayed.
I hope this is ok and doesn't casue any problems down the line.
Cheers for all the help, things seem to be going fairly well, nice bit of kit!
Re: Header Nav Code Modification
still stumped on how to now centre the links
i added text-align centre to the code below but still not centering
Code:
#navMainWrapper, #navSuppWrapper, #navCatTabsWrapper {
margin: 0em;
background-color: #FFFFFF;
font-weight: bold;
color: #F5F4C5;
height: 1%;
}
Re: Header Nav Code Modification
ok, centered
i found:
Code:
.back {
float: none;
}
and:
Code:
#navMain ul, #navSupp ul, #navCatTabs ul {
margin: 0;
padding: 0em;
list-style-type: none;
text-align: center;
}
in stylesheet.css
and changed to what they are as shown above
.back is the class added to the <ul>:
This had a 'left float' on it, so i changed it 'none'. This then freed up #navMain, so i added a text-align:center to that and it worked.
I'm not sure what the long term affects will be by changing the .back class, in stylesheet.css, from float: left, to float: none, will have to wait and see