Page 2 of 2 FirstFirst 12
Results 11 to 13 of 13
  1. #11
    Join Date
    Sep 2009
    Posts
    24
    Plugin Contributions
    0

    Default Re: Highlight the Current Page with CSS

    Hi Glen
    Thank you for your support. I will try your solution and write here later to tell if it works

    @ hcb39

    If I understand correct you want the color of link in Categories box (left navigation) stay white when you are in current category (when link is clicked).
    You need this two classes to be defined in your stylesheet.css

    Code:
    /*top category*/
    .category-subs-selected {
    	color: #FFFFFF;
    	text-decoration: none;
    }
    /*sub category*/
    .category-subs-parent {
    	color: #FFFFFF;
    	text-decoration: none;
    }
    You can change the color of link color: #FFFFFF; or use different colors for top and sub categories links.
    If you want this links to be underlined remove text-decoration: none; or use text-decoration: underline;

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

    Default Re: Highlight the Current Page with CSS

    On reflection, there are so many possible internal link configurations that one line can't account for them. The code you would need is already available in Smart Backgrounds, and the new version 3.0 would make it pretty easy to apply to setting the current/notCurrent class. You can find the zip in this thread until it is submitted to Free Addons.

    It will require that you save an image file named according to a system for each page or category you want to mark (the content of the file doesn't matter).
    The smart_backgrounds() function will return a value of '' (nothing) if an image corresponding to the current page is not found.

    or (smart_backgrounds() != ''))
    PHP Code:
          $page_query_list_header[$rows]['link'] .= (($current_page_base == 'page' and $page_query_list_header[$rows]['id'] == $_GET['id']) or (smart_backgrounds() != ''))? ' class="current"'' class="notCurrent"';//gjh42 20091203 
    The one limitation of this method is that if you highlight a link to a category, any subcategory or product page under that category will also read as "current".

  3. #13
    Join Date
    Sep 2009
    Posts
    24
    Plugin Contributions
    0

    Default Re: Highlight the Current Page with CSS

    @gjh42

    Hi Glen,
    Excuse me, I forgot to write here my solution of the problem.
    It is not exactly a solution, but some kind...
    The links, that I needed in header was EZ pages with internal/external links, who lead to a category or any other page that I want to have in header menu.
    Because I don't change this links often, I edit tpl_header.php, wrote links there and check for "current" page in a way like this:
    Code:
    <a href="index.php?main_page=index&cPath=20" class="
    				<?php if ((in_array($cPath,explode(",",'20,20_24,20_25,20_26,20_27,20_28,20_29,20_30,20_31,20_32,20_33,20_34,20_35'))) or (in_array($current_page_base,explode(",",'advanced_search_result_m')))) {
    	echo 'current';}?>">men's clothing</a><?php echo EZPAGES_SEPARATOR_HEADER;?>
    and of course I define "current" class in css.

    Best regards

 

 
Page 2 of 2 FirstFirst 12

Similar Threads

  1. Flyout Menu highlight current category
    By scott_ease in forum Templates, Stylesheets, Page Layout
    Replies: 5
    Last Post: 28 Jul 2012, 06:06 PM
  2. Highlight Current Link
    By uncharted in forum Templates, Stylesheets, Page Layout
    Replies: 6
    Last Post: 22 Jan 2012, 04:05 AM
  3. regaining highlight of current ezpage
    By dayaki in forum Templates, Stylesheets, Page Layout
    Replies: 0
    Last Post: 5 May 2011, 12:06 PM
  4. Highlight current moreinformation & information sidebox links
    By PhilipB in forum Templates, Stylesheets, Page Layout
    Replies: 0
    Last Post: 10 Mar 2011, 01:13 PM
  5. highlight current link
    By rob222 in forum Templates, Stylesheets, Page Layout
    Replies: 8
    Last Post: 14 Mar 2008, 03:24 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