Results 1 to 10 of 10
  1. #1
    Join Date
    Apr 2007
    Posts
    31
    Plugin Contributions
    0

    Default Positioning Text Element in NavBar

    I added the code from the cart_totals_in_header contribution to my tpl_header.php, and it functions perfectly. The issue is that it always displays at the end of whatever links are displayed, and I would rather have the links on the left (as they already are) but the cart totals displayed at the right of the navbar. Any suggestions about how to accomplish this would be greatly appreciated.

    The is the current code for the navbar:

    <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 }?>
    <li>Cart Contents: <span class="style1">
    <?php echo sizeof($_SESSION['cart']->get_products()); ?> &nbsp;items&nbsp;&nbsp;
    <?php $header_cart = $currencies->format($_SESSION['cart']->show_total());
    echo $header_cart;
    ?>
    </span>
    <br class="clearBoth" />
    </li>
    </ul>
    </div>


    Thanks,
    Bob

  2. #2
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: Positioning Text Element in NavBar

    <li>Cart Contents: <span class="style1">

    Add to your stylesheet

    .style1 { float: right; }

  3. #3
    Join Date
    Apr 2007
    Posts
    31
    Plugin Contributions
    0

    Default Re: Positioning Text Element in NavBar

    I tried that, but it places the cart totals on the next line instead of at the end of the same line. Also, I realized that the 'Cart Contents:' text was outside of the span tag, so I moved it in:

    Old: <li>Cart Contents: <span class="style1">
    New: <li><span class="style1">Cart Contents:

    You can see the current result at: www.superphones.com. Another side effect is that the links are now centered on the top line...

    Thanks,
    Bob

  4. #4
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: Positioning Text Element in NavBar

    The Home Login were always centered, it just wasn't noticeable until the float: right stretched the ul or navMain to full width.
    You didn't mention that, even without the float, the cart info was on the next line.

    I'll have to check on the styling for larger elements, as there is clearly something else affecting this area. The <br class="clearBoth" /> is inside the <li>, but moving it in Edit HTML has no effect. There are no breaks after the Login to put the cart on the next line...

    If the cart info wasn't on the next line before, then you must have changed something else beside the span.

  5. #5
    Join Date
    Apr 2007
    Posts
    31
    Plugin Contributions
    0

    Default Re: Positioning Text Element in NavBar

    I just removed the following line from the stylesheet, and everything is back where I started - links displaying from the left, followed by the cart contents:

    .style1 { float: right; }

    If it matters, I'm using the nightfall template.

    Thanks,
    Bob

  6. #6
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: Positioning Text Element in NavBar

    PHP Code:
    #navMain ul, #navSupp ul, #navCatTabs ul  {
        
    margin0;
        
    padding:  0.5em 0em;
        list-
    style-typenone;
        
    text-aligncenter;
        
    line-height1.5em;
        } 
    This is causing your links to be centered. Change to float:left;

    When I delete the .style1 { float: right; } in Edit CSS, it all moves left but stays on the next line.

  7. #7
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: Positioning Text Element in NavBar

    The Edit CSS has some odd effects on refreshing results. After I shut it down and refreshed, I saw the links all back on one line, and now in Edit CSS adding or deleting .style1 {float:right;} has the same effects you are reporting.

  8. #8
    Join Date
    Apr 2007
    Posts
    31
    Plugin Contributions
    0

    Default Re: Positioning Text Element in NavBar

    Changing from text-align: center; to float: left; of course, also affected CatTabs, so I assume that I could break NavCatTabs off and leave it centered.

    Do you know if this problem is specific to the nightfall template? I have also been having a problem with CatTabs running off the right edge (instead of wrapping) with the Opera browser. I haven't resolved that yet, either.

    Until I get this sorted out, I guess that I'll just leave the cart totals over on the left.

    Thanks for your efforts,
    Bob

  9. #9
    Join Date
    Jul 2005
    Location
    Upstate NY
    Posts
    22,010
    Plugin Contributions
    25

    Default Re: Positioning Text Element in NavBar

    I'm afraid I can't find any reason for this effect, or way to stop it from dropping down.
    Sorry. Maybe another pair of eyes can help...

    Yes, you should separate out #navMain or any of its subs that you modify.

    Oh, you should post in the Nightfall template support thread. Read first to see if this has occurred before.
    Last edited by gjh42; 11 May 2007 at 04:17 AM.

  10. #10
    Join Date
    Aug 2006
    Posts
    67
    Plugin Contributions
    0

    Default Re: Positioning Text Element in NavBar

    Hi,

    I have a similar problem: I want to right-align the Home and Login text in my navBar (not sure if this the fist bar above the logo and sales message part). I tried adding (or changing) the text-align:right and float:right in the css file to #navMain, #navMain ul li and other different combinations but the Top text always keeps displaying on the left. I even tried the same css code on #navMainWrapper but to no avail. Can you please help me?

    Hansi

 

 

Similar Threads

  1. Replies: 1
    Last Post: 11 Jul 2016, 02:04 PM
  2. v151 element positioning issue
    By godt in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 31 Mar 2014, 12:56 AM
  3. v139h Change text color in Navbar Ttitle
    By traytray in forum Templates, Stylesheets, Page Layout
    Replies: 17
    Last Post: 27 Jun 2013, 02:10 AM
  4. Supplemental navbar text will not re-set size
    By Goldenis in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 28 Dec 2010, 12:06 AM
  5. Text/Image Positioning Help
    By Chris10 in forum Templates, Stylesheets, Page Layout
    Replies: 9
    Last Post: 30 Apr 2010, 11:53 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR