Results 1 to 10 of 10
  1. #1
    Join Date
    May 2010
    Posts
    5
    Plugin Contributions
    0

    Default How do I bold my at links in the footer?

    I need my at links to be bolded on the footer. My code in tpl_ezpages_bar_footer.php is below, the problem is with the if statements, the first EZ Pages menu item shows up in bold on that page, but on each page after that, no bolded at links. I'm guessing this has something to do with conditional statements inside the for loop.

    include(DIR_WS_MODULES . zen_get_module_directory('ezpages_bar_footer.php'));
    ?>
    <?php // NW EDIT
    $uri = $_SERVER['REQUEST_URI'];
    $uri_ez = 'http://www.sapphirebaking.com' . $uri;
    ?>
    <?php if (sizeof($var_linksList) >= 1) { ?>
    <?php for ($i=1, $n=sizeof($var_linksList); $i<=$n; $i++) { ?>
    <?php echo ($i <= $n ? EZPAGES_SEPARATOR_FOOTER : '') . "\n"; ?>

    <?php // NW EDIT

    if ($uri_ez == $var_linksList[$i]['link']) {
    echo '<li id="foot_menu_item_at">';
    }
    elseif ($uri_ez != $var_linksList[$i]['link']) {
    echo '<li class="foot_menu_item">';
    }

    ?>

    <a class="foot_menu_link" href="<?php echo $var_linksList[$i]['link']; ?>"><?php echo $var_linksList[$i]['name']; ?></a></li>

    <?php } // end FOR loop ?>
    <?php } ?>

    Thanks in advance,

    webman

  2. #2
    Join Date
    Jun 2005
    Location
    Cumbria, UK
    Posts
    10,266
    Plugin Contributions
    3

    Default Re: At links redefined

    Keep out of the raw PHP... !

    Styles are applied in the stylesheets.

    Use firefox browser with firebug plugin to do offline analysis of your displayed page. Firebug will reveal the style CLASSES and ID's governing any specific DIV.

    Then, use CSS declarations to style that div.

    NO NEED TO HACK AT THE CODE !
    20 years a Zencart User

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

    Default Re: At links redefined

    The original code doesn't have a way to identify the current ez-page link, so some code modification would be necessary there.

  4. #4
    Join Date
    May 2010
    Posts
    5
    Plugin Contributions
    0

    Idea or Suggestion Re: At links redefined

    First, thank you for the responses. Sorry I was so slow to respond.

    In this case there are no classes or ids defined for the actual LI list item (which I need to use as I did outside the cart) but I can change the UL unordered list with plain HTML and then use

    UL#menu_list > li to change the styles. -> possible compatibility issues

    BUT,
    this strategy doesn't allow me to use different styles for different pages, what I need is the Privacy link to be bold on the privacy page and only the privacy page, the terms on the terms page etc.

    Fresh idea, to stay out of the PHP (good advice), I could set a separate stylesheet for each page on the EZ pages menu, making sure that I use precedence rules to override the main stylesheet.

    STILL,
    not sure this will work because each LI list item would require a separate ID.

    I'll give this a whirl and post back here.

    webman10

  5. #5
    Join Date
    Jun 2005
    Location
    Cumbria, UK
    Posts
    10,266
    Plugin Contributions
    3

    Default Re: At links redefined

    I manage to style the EP footer links no problem... bold, italic, red, blue, pink, large, small, underline.....

    There are serveral levels...

    #navSupp {}

    #navSupp ul li {}

    #navSupp ul li a {}
    20 years a Zencart User

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

    Default Re: At links redefined

    You can style the links differently by using adjacent selectors to affect first, second, third, etc. items:
    #navSupp ul li a {}
    #navSupp ul li+li a {}
    #navSupp ul li+li+li a {}
    ...

    This still doesn't address the current page issue, but you can combine it with per-page stylesheets for ez-pages and it actually could get the desired current page styling without PHP coding.
    Note that this will not work in IE6 as it doesn't support adjacent selectors.
    It also would need to be manually adjusted if your ez-page footer links change.

  7. #7
    Join Date
    Jun 2005
    Location
    Cumbria, UK
    Posts
    10,266
    Plugin Contributions
    3

    Default Re: At links redefined

    I really don't know if this will help, but in the PURE_BLACK template produced by a group called zen-cart-power, they have a template file called tpl_top_nav.php that uses a BG image to indicate an AT page.

    So, in their standard header menu, there are links such as "New Products" and the link has a hover background (controlled in the stylesheets)... and when you select the link, the BG image remains "on"... if you see what I mean

    Anyway... here's an example of the PHP they use to create that effect..

    PHP Code:
    <div id="top_nav">
    <div id="tab_nav">
    <!--<div class="top-nav-left"></div>-->
    <div class="top-nav-right"></div>
        <ul class="list-style-none">
            <li class="home-link"><a href="<?php echo '' HTTP_SERVER DIR_WS_CATALOG;?>"><!--img src="images/spacer.gif" width="1" height="14" alt=""--></a></li>

    <?php
    if ($current_page_base == 'products_new') {    $active    'tab_active'
        } else { 
    $active '';
    }
    ?>
            <li id="<?php echo $active;?>"><a href="index.php?main_page=products_new"><?php echo TOP_MENU_NEW_PRODUCTS;?></a></li>

    <?php
    if ($current_page_base == 'specials') { $active 'tab_active'
        } else { 
    $active '';
    }
    ?>
            <li id="<?php echo $active;?>"><a href="index.php?main_page=specials"><?php echo TOP_MENU_SPECIALS;?></a></li>

    <?php
    if ($current_page_base == 'account' || $current_page_base == 'login' || $current_page_base == 'account_edit' || $current_page_base == 'address_book' || $current_page_base == 'account_password' || $current_page_base == 'account_newsletters' || $current_page_base == 'account_notifications') { $active 'tab_active'
        } else { 
    $active '';
    }
    ?>
            <li id="<?php echo $active;?>"><a href="<?php echo zen_href_link(FILENAME_ACCOUNT'''SSL'); ?>"><?php echo TOP_MENU_MY_ACCOUNT;?></a></li>

    <?php
    if ($current_page_base == 'shopping_cart') { $active 'tab_active'
        } else { 
    $active '';
    }
    ?>
            <li id="<?php echo $active;?>"><a href="<?php echo zen_href_link(FILENAME_SHOPPING_CART'''NONSSL'); ?>"><?php echo TOP_MENU_VIEW_CART;?></a></li>
        </ul>
    </div>
    Please note... this is CUSTOM code from zen-cart-power and is possibly subject to copyright.
    20 years a Zencart User

  8. #8
    Join Date
    May 2010
    Posts
    5
    Plugin Contributions
    0

    Default Re: At links redefined

    Thank both of you for the help, still no solution, I'm currently working (and having a helluva time) on descendant, child, adjacent selectors, using every possible combination. I can bold them all this way but not just one (problem with adjacent). I'll post final solution, if you have any more suggestions I'll check them out.
    -webman

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

    Default Re: At links redefined

    Say you want to bold only the third link.
    Code:
    #navSupp ul li a {font-weight: normal;} 
    #navSupp ul li+li+li a {font-weight: bold;} 
    #navSupp ul li+li+li+li a {font-weight: normal;}
    The four li rule will apply to the fourth and following items.

  10. #10
    Join Date
    Jun 2005
    Location
    Cumbria, UK
    Posts
    10,266
    Plugin Contributions
    3

    Default Re: At links redefined

    Quote Originally Posted by gjh42 View Post
    Say you want to bold only the third link.
    Code:
    #navSupp ul li a {font-weight: normal;} 
    #navSupp ul li+li+li a {font-weight: bold;} 
    #navSupp ul li+li+li+li a {font-weight: normal;}
    The four li rule will apply to the fourth and following items.
    Glenn... your superior brain just astounds me sometimes.. such an elegant solution!
    20 years a Zencart User

 

 

Similar Threads

  1. how to delete/add links in the footer?
    By musclecomp in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 22 Aug 2011, 08:16 PM
  2. How to change links at the top of the page & in the footer
    By sc436 in forum Templates, Stylesheets, Page Layout
    Replies: 5
    Last Post: 31 Jan 2011, 08:47 PM
  3. Help! How to change the footer? Links inside!
    By Xandrouz in forum Templates, Stylesheets, Page Layout
    Replies: 10
    Last Post: 21 Dec 2009, 10:22 PM
  4. how to make Links in menu bold when on there page?
    By jamesdavid in forum General Questions
    Replies: 0
    Last Post: 8 Jun 2008, 11:11 AM
  5. How can I get rid of links in the footer
    By Marlake in forum Customization from the Admin
    Replies: 6
    Last Post: 29 Apr 2008, 04:49 PM

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