New Zenner
- Join Date:
- Aug 2007
- Posts:
- 37
- Plugin Contributions:
- 0
Adding a link to the top of the page
Hi!
How can I add a link to the top of the page (Where "Home", "Log in", etc. show)?
Thank you!
- Paul
Started by paulriedel on 12 Aug 2007, 6:44 AM · Views: 1,432
New Zenner
Hi!
How can I add a link to the top of the page (Where "Home", "Log in", etc. show)?
Thank you!
Black Belt
There are several that do not display until logged in and till there is cart contents so you will have to determine where in this string that you want yours to be displayed.
In a copy of the file that you place in your template /common folder named tpl_header.php find this code that is all of the items that can appear and insert yours as an additional li with your associated href
<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>
Zen-Venom Get Bitten
New Zenner
Awsome!
Thanks a lot!
Just one more question about this: can I align the newly added links to the right somehow?
When I just add another div container it is not formatted correctly anymore.
Do you have an idea?
Thanks!!
Black Belt
Try this
<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 }?>
<div id="?newdivname?">
<ul class="forward">
<li><a href="http://your link.com/">Name to appear</a></li>
</div>
</ul>
</div>
Zen-Venom Get Bitten
New Zenner
Hi!
Thanks a lot, but I have tried this and it doesn't work. :no:
The new links are then in a second line, not next to, and aligned to the right of the main-links, but underneath and aligned to the right of the main-links.
Do you maybe have another idea?
Thanks!
Black Belt
OK this will get it:
<?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="nav2"><a href="http://your link.com/">Link To Nothing</a></div>
<div class="navMainSearch forward"><?php require(DIR_WS_MODULES . 'sideboxes/search_header.php'); ?></div>
<br class="clearBoth" />
</div>
and in the stylesheet add:
#nav2 {
float: right;
margin: 0.5em;
}
Zen-Venom Get Bitten
Tell staff why this post should be reviewed.