Zen Cart Logo

A list question...

Locked

Views: 2,072

Results 1 to 14 of 14
This thread is locked. New replies are disabled.
8 Jan 2007, 10:07 AM
#1
alex_clarke avatar

alex_clarke

Totally Zenned

Join Date:
Mar 2006
Posts:
909
Plugin Contributions:
1

A list question...

I've noticed that the navMain links (or account links) contained in the header of Zen Cart are coded in a basic un-ordered list.

At the moment I've modified the list, to contain a few more items. However, I would like to place one line of text below on of the list items (while keeping it inline), but don't know how! :(

Please see the image below. I'm looking for a way to add the text 'example text'.

Any help would be great! :)

8 Jan 2007, 10:36 AM
#2
kobra avatar

kobra

Black Belt

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

Re: A list question...

you could try this for a linked entry you would have to add the link and this can be the placement of an image/button or?
I have also made it a div for css styling directly if needed and aligned right with forward

<div id="headerWrapper">
<!--bof-navigation display-->
<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>
<div id="navMainSearch"><?php require(DIR_WS_MODULES . 'sideboxes/search_header.php'); ?></div>
<br class="clearBoth" />
</div>
<div id="example">
    <ul class="forward">
    <li><?php echo '<a href="some file location link">Example Text';?></a></li>
</div>
<br class="clearBoth" />
</div>
<!--eof-navigation display-->

Try it, as I am not excellect in the php area but it should work and not error

8 Jan 2007, 11:46 AM
#3
alex_clarke avatar

alex_clarke

Totally Zenned

Join Date:
Mar 2006
Posts:
909
Plugin Contributions:
1

Re: A list question...

Thanks for the above. :)

However, I know how to add links and so on, but I'm a little confused as to how I can get the 'example text' to sit directly below 'View Basket'.

Wouldn't the second list (that you advised me to add) have to be aligned exactly?

8 Jan 2007, 6:25 PM
#4
gjh42 avatar

gjh42

Black Belt

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

Re: A list question...

Kobra's suggestion would work for the case that you posted, with the example text under the rightmost (and right-aligned) element on the row.
Other situations would require different solutions.

8 Jan 2007, 7:41 PM
#5
alex_clarke avatar

alex_clarke

Totally Zenned

Join Date:
Mar 2006
Posts:
909
Plugin Contributions:
1

Re: A list question...

Kobra it works! :)

However, I had to change the first </div> to </ul>. So, the final code looked like...

<div id="example">
    <ul class="forward">
    <li><?php echo '<a href="some file location link">Example Text';?></a></li>
</ul>
<br class="clearBoth" />
</div>

Thanks for the help.

10 Jan 2007, 9:46 AM
#6
alex_clarke avatar

alex_clarke

Totally Zenned

Join Date:
Mar 2006
Posts:
909
Plugin Contributions:
1

Re: A list question...

Ok, so I've got it working and updated my live site.

https://www.beyondeuphoria.co.uk (adult content)

Everything looks fine in IE(7), but not Firefox(2)!

If you're using Firefox and add something to the basket you'll notice a great big gap between the 'View Basket' link and the actually items/price text.

This gap is much smaller (and nicer) in IE.

I've tried playing around with the CSS, but had no luck. Maybe it's a code issue?

10 Jan 2007, 10:05 AM
#7
kobra avatar

kobra

Black Belt

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

Re: A list question...

Alex,

I can only see the source but this is what turns up:

<!--bof-navigation display-->
<div id="navMainWrapper">
<div id="navMain">
    <ul class="forward">
<!-- bof header navigation - aclarke - 080107 -->
	
    <li><a href="https://www.beyondeuphoria.co.uk/login.html">Login / Register</a></li>
	<li><a href="https://www.beyondeuphoria.co.uk/account.html">Your Account</a></li>
	<li><a href="http://www.beyondeuphoria.co.uk/shopping_cart.html">View Basket</a></li>
</ul>
</div>

<div id="navMainSubText">
<ul class="forward">
<li><a href="http://www.beyondeuphoria.co.uk/shopping_cart.html">1 items, £7.66</a></li>
</ul>
<br class="clearBoth" />
</div>
<!-- eof header navigation - aclarke - 080107 -->

Can you rearrange the code in your tpl_header.php to get closer to this, bringing the price into the same ul list:

<!--bof-navigation display-->
<div id="navMainWrapper">
<div id="navMain">
    <ul class="forward">
<!-- bof header navigation - aclarke - 080107 -->
	
    <li><a href="https://www.beyondeuphoria.co.uk/login.html">Login / Register</a></li>
	<li><a href="https://www.beyondeuphoria.co.uk/account.html">Your Account</a></li>
	<li><a href="http://www.beyondeuphoria.co.uk/shopping_cart.html">View Basket</a></li>
<li><a href="http://www.beyondeuphoria.co.uk/shopping_cart.html">1 items, £7.66</a></li>
</ul>
<br class="clearBoth" />
</div>
<!-- eof header navigation - aclarke - 080107 -->
10 Jan 2007, 10:14 AM
#8
alex_clarke avatar

alex_clarke

Totally Zenned

Join Date:
Mar 2006
Posts:
909
Plugin Contributions:
1

Re: A list question...

I'll give it a go. If it doesn't work will it help if I post my source code?

10 Jan 2007, 10:16 AM
#9
kobra avatar

kobra

Black Belt

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

Re: A list question...

Yes, or zip it and provide a DL Link and it can be worked on in full

10 Jan 2007, 8:33 PM
#10
alex_clarke avatar

alex_clarke

Totally Zenned

Join Date:
Mar 2006
Posts:
909
Plugin Contributions:
1

Re: A list question...

Ok, I've tried the previous code alteration and it hasn't worked.

I am trying to close the vertical gap/space between the 'View Basket' link and the '1 items, £29.95' text.

The solution you mentioned just added the '1 items, £29.95' text into the same UL, which displayed it after the 'View Basket' text and not below.

Hope that makes sense! :S

Any further ideas?

11 Jan 2007, 5:45 PM
#11
gjh42 avatar

gjh42

Black Belt

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

Re: A list question...

What you want is a break between the previous list items and your price item, to put it on the next line.

It may work just to insert a <br /> in the list. Or, you may need a new list after the break for your item - not sure.

11 Jan 2007, 9:26 PM
#12
alex_clarke avatar

alex_clarke

Totally Zenned

Join Date:
Mar 2006
Posts:
909
Plugin Contributions:
1

Re: A list question...

I've already tried adding a second list. This is what I currently have on my site. It looks fine in IE(7), but bad in Firefox! :(

11 Jan 2007, 10:21 PM
#13
gjh42 avatar

gjh42

Black Belt

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

Re: A list question...

Did you try just inserting a <br /> in the one list?

11 Jan 2007, 10:36 PM
#14
alex_clarke avatar

alex_clarke

Totally Zenned

Join Date:
Mar 2006
Posts:
909
Plugin Contributions:
1

Re: A list question...

This was the first thing I tried... originally with it being to 'easiest' solution to my problem. However, it didn't work.

But, after reading your post I began to think... I had some text-align: center attached to that div (which was meaning my '1 for £29.95' text was not sitting under the 'View Basket' text.

So I've changed text-align: center to right and it works!

Thanks for your post - it really helped to get my brain in gear! :)