Results 1 to 3 of 3
  1. #1
    Join Date
    May 2006
    Posts
    725
    Plugin Contributions
    0

    Default Current Page Base

    Hello,

    Im doing a navigation that highlights the active page but I cant seem to do it for categories or ezpages.
    The code I have below is what I use for home, specials, new products pages etc.

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

    I tried changing the 'specials' to 'cPath#' but nothing happens. I also tried $current_category_id == 'cPath#' but didnt change anything.
    Can someone please point me in the right direction.

    Thank you

  2. #2
    Join Date
    May 2006
    Posts
    725
    Plugin Contributions
    0

    Default Re: Current Page Base

    Managed to get the category to be highlighted by using:

    <?php
    if ($current_category_id == '1') { $active = 'tab_active';
    } else { $active = '';
    }?>
    <li id="<?php echo $active;?>"><a href="index.php?main_page=index&cPath=1">Category 1</a></li>

    The problem with this now is that when the category is highlighted, the index is as well. Not sure why it does that unless im calling the wrong page base.
    Below is what I have for the home button.

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

    Is the above correct?

  3. #3
    Join Date
    May 2006
    Posts
    725
    Plugin Contributions
    0

    Default Re: Current Page Base

    problem sorted in the following thread

    http://www.zen-cart.com/forum/showth...=162598&page=2

 

 

Similar Threads

  1. v151 Change Current Page 1 2 3 4 5 ... [Next >>]
    By joem83 in forum Setting Up Categories, Products, Attributes
    Replies: 2
    Last Post: 13 Feb 2014, 04:57 AM
  2. Current Page Variable?
    By split63 in forum General Questions
    Replies: 3
    Last Post: 15 Jul 2010, 10:25 AM
  3. How to determine current page
    By MyGreyGoose in forum Templates, Stylesheets, Page Layout
    Replies: 6
    Last Post: 15 Nov 2008, 12:52 AM
  4. Need Current Page Number on Product List Page
    By kwright in forum General Questions
    Replies: 1
    Last Post: 21 Oct 2008, 11:56 PM

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