Results 1 to 10 of 10
  1. #1
    Join Date
    Dec 2006
    Location
    Northwest Connecticut
    Posts
    87
    Plugin Contributions
    0

    Default #navEZPagesTop active link color

    I have specified #navEZPagesTop a:hover { color: blue;}
    #navEZPagesTop a:active { color: blue; } at the bottom of the stylesheet and the hover specification works, the active one doesn't.

    Here is the site I am working on http://peterfasano.com/zen/ and I would like to have the navEZPagesTop link for the current or active page highlighted to indicate where you are in the site. I appreciate any help, have looked in the forum as I thought there must be something about this, but haven't found it.

  2. #2
    Join Date
    Apr 2006
    Location
    Texas
    Posts
    6,196
    Plugin Contributions
    0

    Default Re: #navEZPagesTop active link color

    He,
    Working great in firefox, When I hover they change to blue

  3. #3
    Join Date
    Dec 2006
    Location
    Northwest Connecticut
    Posts
    87
    Plugin Contributions
    0

    Default Re: #navEZPagesTop active link color

    Yes, the hovering is working, but not the active....when you click on whatever link and go to a specific page, the link for that page should be highlighted in blue, and it isn't. I can't figure out why not....

  4. #4
    Join Date
    Apr 2006
    Location
    Texas
    Posts
    6,196
    Plugin Contributions
    0

    Default Re: #navEZPagesTop active link color

    Helen,
    how about #navEZPagesTop a:visited

    Or,
    #navEZPagesTop A:active {background: #FFCC00; text-decoration: none}

  5. #5
    Join Date
    May 2009
    Posts
    64
    Plugin Contributions
    0

    Default Re: #navEZPagesTop active link color

    So you still didn't get the a:active to work as it should. Got the same problem.

  6. #6
    Join Date
    May 2009
    Posts
    64
    Plugin Contributions
    0

    Default Re: #navEZPagesTop active link color

    The problem is, that a:active doesn't work the way you think.
    a:active just lights up at the moment you click the link.

    You would have to change the CSS-class of the link that corresponds to the page you have loaded!

  7. #7
    Join Date
    May 2009
    Posts
    64
    Plugin Contributions
    0

    Default Re: #navEZPagesTop active link color

    You would have to edit the file tpl_ezpages_bar_header.php in includes\templates\YOUR_TEMPLATE\templates in order to generate the link with the correct CSS-class.

    Example: Add this after the last include, after line 18.

    Code:
    <?php 
    $akt_seite= htmlspecialchars('http://'.$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI']);
    ?>
    This code will tell your php-script, which page is loaded by the client.

    Then you have to find the line, where the links are generated and add a if-statement for the class="xxx". The if-statement will compare the actualy loaded page with the url in the link.

    Example:

    Code:
      <div <?php if($akt_seite != $var_linksList[$i]['link']) echo 'class="topLink"'; else echo 'class="topLinkActive"'; ?> ><a href="<?php echo $var_linksList[$i]['link']; ?>"><?php echo $var_linksList[$i]['name']; ?></a></div>
    The original code would create a <ul> and <li>, I do use <div>, but you should be able to integrate this with <ul><li> too.

    Well, this way you can now create the two needed CSS classes. Example: .topLink a{color: grey;} and .topLinkActive a{color: blue;} -> for <ul><li> figure it out by yourself.

    I guess that I will have to edit other files too, as there are links generated in other places too. But now you know how to do this.


  8. #8
    Join Date
    May 2009
    Posts
    64
    Plugin Contributions
    0

    Default Re: #navEZPagesTop active link color

    On your page [http://peterfasano.com/zen/] you do not even use <ul><li> but just the <a herf..>.

    So, add the if-statement into this like <a href=.. class=...>...</a>

  9. #9
    Join Date
    May 2009
    Posts
    64
    Plugin Contributions
    0

    Default Re: #navEZPagesTop active link color

    That is what I needed:

    Code:
    <?php
    /**
     * Page Template
     *
     * Displays EZ-Pages Header-Bar content.<br />
     *
     * @package templateSystem
     * @copyright Copyright 2003-2006 Zen Cart Development Team
     * @copyright Portions Copyright 2003 osCommerce
     * @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
     * @version $Id: tpl_ezpages_bar_header.php 3377 2006-04-05 04:43:11Z ajeh $
     */
    
      /**
       * require code to show EZ-Pages list
       */
      include(DIR_WS_MODULES . zen_get_module_directory('ezpages_bar_header.php'));
    ?>
    
    
    
    <?php 
    /* aktuelle seitenURL auslesen, um die class der aktiven SeitenLinks zu ändern */
    $akt_seite= htmlspecialchars('http://'.$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI']);
    //htmlspecialchars needet because of & or &amp;
    //echo $akt_seite;
    ?>
    
    
    
    <?php // tht fix für startseite ?>
    <div <?php if(($akt_seite == HTTP_SERVER.DIR_WS_CATALOG.'index.php') || ($akt_seite == HTTP_SERVER.DIR_WS_CATALOG)) echo 'class="startseiteLinkActive"'; else echo 'class="startseiteLink"'; ?> >
        <?php echo '<a href="' . HTTP_SERVER . DIR_WS_CATALOG . '">'; ?><?php echo HEADER_TITLE_CATALOG; ?></a>
    </div>
    
    <?php if (sizeof($var_linksList) >= 1) { ?>
    
    <?php for ($i=1, $n=sizeof($var_linksList); $i<=$n; $i++) {  ?>
      <div <?php if($akt_seite != $var_linksList[$i]['link']) echo 'class="topLink"'; else echo 'class="topLinkActive"'; ?> ><a href="<?php echo $var_linksList[$i]['link']; ?>"><?php echo $var_linksList[$i]['name']; ?></a></div>
    <?php } // end FOR loop ?>
    
    
    <?php // tht fix für anmelden abmelden usw ?>
    <?php if ($_SESSION['customer_id']) { ?>
        <div <?php if($akt_seite != zen_href_link(FILENAME_LOGOFF, '', 'SSL')) echo 'class="topLink"'; else echo 'class="topLinkActive"'; ?> ><a href="<?php echo zen_href_link(FILENAME_LOGOFF, '', 'SSL'); ?>"><?php echo HEADER_TITLE_LOGOFF; ?></a></div>
    <!--    <div <?php if($akt_seite != zen_href_link(FILENAME_ACCOUNT, '', 'SSL')) echo 'class="topLink"'; else echo 'class="topLinkActive"'; ?> ><a href="<?php echo zen_href_link(FILENAME_ACCOUNT, '', 'SSL'); ?>"><?php echo HEADER_TITLE_MY_ACCOUNT; ?></a></div> -->
    <?php
          } else {
            if (STORE_STATUS == '0') {
    ?>
        <div <?php if($akt_seite != zen_href_link(FILENAME_LOGIN, '', 'SSL')) echo 'class="topLink"'; else echo 'class="topLinkActive"'; ?> ><a href="<?php echo zen_href_link(FILENAME_LOGIN, '', 'SSL'); ?>"><?php echo HEADER_TITLE_LOGIN; ?></a></div>
    <?php } } ?>
    
    <?php if ($_SESSION['cart']->count_contents() != 0) { ?>
        <div <?php if($akt_seite != zen_href_link(FILENAME_SHOPPING_CART, '', 'NONSSL')) echo 'class="topLink"'; else echo 'class="topLinkActive"'; ?> ><a href="<?php echo zen_href_link(FILENAME_SHOPPING_CART, '', 'NONSSL'); ?>"><?php echo HEADER_TITLE_CART_CONTENTS; ?></a></div>
        <div <?php if($akt_seite != zen_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL')) echo 'class="topLink"'; else echo 'class="topLinkActive"'; ?> ><a href="<?php echo zen_href_link(FILENAME_CHECKOUT_SHIPPING, '', 'SSL'); ?>"><?php echo HEADER_TITLE_CHECKOUT; ?></a></div>
    <?php }?>
    <?php } ?>
    <div class="topLinkEnd"></div>

  10. #10
    Join Date
    Dec 2006
    Location
    Northwest Connecticut
    Posts
    87
    Plugin Contributions
    0

    Default Re: #navEZPagesTop active link color

    Thanks, I'm going to read through all the posts again and see if I can get it to work tomorrow, I'll let you know -

 

 

Similar Threads

  1. v154 change the color of active links category
    By diamond1 in forum Templates, Stylesheets, Page Layout
    Replies: 18
    Last Post: 19 Oct 2015, 07:02 AM
  2. navMain active page link in different color
    By shopkiper in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 8 Jan 2011, 04:50 PM
  3. Link colors in navEZPagesTop
    By karine in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 3 Jan 2011, 02:11 PM
  4. changing #navEZPagesTop a:visited color
    By wachtn in forum Templates, Stylesheets, Page Layout
    Replies: 5
    Last Post: 19 Jun 2009, 09:18 PM
  5. How Do I Change Font Color on CSS navEZPagesTop
    By Bob88Vette in forum General Questions
    Replies: 7
    Last Post: 27 Jul 2008, 07:17 AM

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