Page 3 of 6 FirstFirst 12345 ... LastLast
Results 21 to 30 of 55
  1. #21
    Join Date
    Feb 2007
    Location
    New York
    Posts
    88
    Plugin Contributions
    0

    Default Re: #categories li a.cat-selected-text but for EZPAGES

    I've done that, Glenn.
    Thank you very much for helping me. I really appreciate it!

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

    Default Re: #categories li a.cat-selected-text but for EZPAGES

    This should function for all internal links whether generic or specific, as well as for home links. Please test it and let me know how it works for you.
    PHP Code:
      }elseif ($var_linksList[$i]['altURL']) {//check for current page in alturl
        
    $active = ((strstr($_GET['url'],$var_linksList[$i]['altURL']) and (strstr($var_linksList[$i]['altURL'],'/index.php') != '/index.php')) or ($_GET['url'] == $var_linksList[$i]['altURL']))?' class="activeILPage"''';
      } 
    ?> 

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

    Default Re: #categories li a.cat-selected-text but for EZPAGES

    $i=1 current page=page id=6 listid=3 About Us ::

    This says (when on the About Us page) that the actual ez-page id is 6, while the link is pointing to ez-page id 3; thus they don't match and the link code doesn't think it is the current page. I don't know how this can be... if the link gets to the right ez-page, they should match.

  4. #24
    Join Date
    Feb 2007
    Location
    New York
    Posts
    88
    Plugin Contributions
    0

    Default Re: #categories li a.cat-selected-text but for EZPAGES

    Glenn,

    Most links work now but one strange thing happened..
    Now if you click on/go to "Home", the "products" turns red too.

    And when click on "Products", it doesn't turn red. ("Products" is pointed to "index.php?main_page=product_info&cPath=1" on ezpage setting.)

    How do I apply this to ezpage sidebox? Would you tell me how to do that for ezpage sidebox?

    Thanks, Glenn.

    PS. I've "fixed" the "about us". I noticed that "about us" header order was "3" and sidebox order was "6". I changed both to"6" and it works now.

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

    Default Re: #categories li a.cat-selected-text but for EZPAGES

    Product or category listings are "index" pages, as is the home page, so the post #20 code's

    strstr($var_linksList[$i]['altURL'],'main_page=' . $current_page_base)

    will be positive when the link has main_page=index and you are on the home page.
    This will probably be taken care of with the latest version of the test in post #22.
    If that works correctly, I will proceed to transfer it into the sidebox.

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

    Default Re: #categories li a.cat-selected-text but for EZPAGES

    The "Products" link is not turning red on the product page because you have only one product in the category, and Zen Cart is following the default setting and going straight to the product info page in this case

    main_page=product_info&cPath=1&products_id=1

    while the link says

    main_page=index&cPath=1

    I think even the improved code wouldn't pick up on this; you would need to use the individual product as the link destination. The only practical way I could see this situation arising without writing the link by hand is if a category had two products when the link was made and then had one deleted. Copy/pasting the internal link destinations is a good way to be sure they are right.

  7. #27
    Join Date
    Feb 2007
    Location
    New York
    Posts
    88
    Plugin Contributions
    0

    Default Re: #categories li a.cat-selected-text but for EZPAGES

    Yes, it works!! (I pointed the "products" to "index.php?main_page=product_info" for the moment..)

    Please go ahead and transfer it into ezpage sidebox. I'm so happy that this can be done. I cannot thank you enough..

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

    Default Re: #categories li a.cat-selected-text but for EZPAGES

    I transferred the testing code into a function, so only one line in both the header and sidebox tpl_ files needs to be altered, calling the function.
    /includes/functions/extra_functions/ezpages_improved_menus_functions.php
    PHP Code:
    <?php
    /**
     *
     * @copyright Copyright 2010 Glenn Herbert
     * @copyright Portions Copyright 2003-2006 Zen Cart Development Team
     * @copyright Portions Copyright 2003 osCommerce
     * @license http://www.gnu.org/licenses/ GNU Public License V3.0
     * @version $Id: /includes/functions/extra_functions/ezpages_improved_menus_functions.php 
     *Ezpages Improved Menus by Glenn Herbert (gjh42) 2010-08-23
     */

    //call as   activePageClass($var_linksList[$i]['id'],$var_linksList[$i]['altURL']);
    function active_page_class($ezpid,$alturl) {
      
    $active '';
      if(
    $current_page_base == 'page') { 
        
    $active = ($_GET['id'] == $ezpid)? ' class="activeEZPage"''';
      }elseif(
    $alturl) {//check for current page in alturl
        
    $active = ((strstr($_GET['url'],$alturl) and (strstr($alturl,'/index.php') != '/index.php')) or ($_GET['url'] == $alturl))?' class="activeILPage"''';
      }
      return 
    $active;
    }
    ?>
    /includes/templates/your_template/sideboxes/tpl_ezpages.php
    PHP Code:
    <?php
    /**
     * Side Box Template
     *
     * @package templateSystem
     * @copyright Copyright 2003-2005 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.php 2982 2006-02-07 07:56:41Z birdbrain $
     * /includes/templates/your_template/sideboxes/tpl_ezpages.php
     *Modified for Ezpages Improved Menus by Glenn Herbert (gjh42) 2010-08-23
     */
      
    $content "";
      
    $content .= '<div id="' str_replace('_''-'$box_id 'Content') . '" class="sideBoxContent">';
      
    $content  .= "\n" '<ul>' "\n";
      for (
    $i=1$n=sizeof($var_linksList); $i<=$n$i++) { 
        
    $content .= '<li><a href="' $var_linksList[$i]['link'] . '"' active_page_class($var_linksList[$i]['id'],$var_linksList[$i]['altURL']) . '>' $var_linksList[$i]['name'] . '</a></li>' "\n" ;
      } 
    // end FOR loop
      
    $content  .= '</ul>' "\n";
      
    $content .= '</div>';
    ?>
    /includes/templates/your_template/templates/tpl_ezpages_bar_header.php
    PHP 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 $
     * /includes/templates/your_template/templates/tpl_ezpages_bar_header.php
     *Modified for Ezpages Improved Menus by Glenn Herbert (gjh42) 2010-08-23
     */
      /**
       * require code to show EZ-Pages list
       */
    include(DIR_WS_MODULES zen_get_module_directory('ezpages_bar_header.php'));

    if (
    sizeof($var_linksList) >= 1) { ?>
    <div id="navEZPagesTop">
    <ul>
    <?php for ($i=1$n=sizeof($var_linksList); $i<=$n$i++) { 
        echo 
    '<li class="link"><a href="' $var_linksList[$i]['link'] . '"' active_page_class($var_linksList[$i]['id'],$var_linksList[$i]['altURL']) . '>' $var_linksList[$i]['name'] . '</a></li>' . ($i $n '<li class="separator">' EZPAGES_SEPARATOR_HEADER '</li>' '') . "\n";
      } 
    // end FOR loop ?>
    </ul>
    </div>
    <?php ?>
    I did modify the header bar file a bit, for streamlined code and to make the list a <ul> for more flexible styling. This requires an addition to the stylesheet to keep the appearance the same as before.
    I also pulled the inline styling out of the sidebox file, so it needs to go in the stylesheet as well, in addition to the new active class style rules.
    Code:
    #navEZPagesTop ul {margin: 0; padding: 0; list-style-type: none;}
    #ezpagesContent ul {margin: 0; padding: 0; list-style-type: none;}
    .activeEZPage {color: #ff0000;}
    .activeILPage {color: #ff0000;}
    As there are numerous tweaks from the previous version to this one, please test to make sure there are no typos or bugs introduced.
    Last edited by gjh42; 23 Aug 2010 at 11:13 PM.

  9. #29
    Join Date
    Feb 2007
    Location
    New York
    Posts
    88
    Plugin Contributions
    0

    Default Re: #categories li a.cat-selected-text but for EZPAGES

    Glenn,

    I created a PHP file:
    /includes/functions/extra_functions/ezpages_improved_menus_functions.php

    and made all the changes according to your instructions, but nothing seems to happen now..

    I feel bad that you are doing all the work. Please have a look when you get a chance. Really appreciate it!

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

    Default Re: #categories li a.cat-selected-text but for EZPAGES

    Note: you also want to display the header items inline:

    #navEZPagesTop ul li {display: inline;}

    You are helping me test the mod, so don't feel bad. We will need to put some debug lines back into the files.

    ezpages_improved_menus_functions.php
    PHP Code:
    function active_page_class($ezpid,$alturl) {
      
    $active '';
      echo 
    '<br /> current_page='.$current_page_base;//debug
      
    if($current_page_base == 'page') { 
        echo 
    ' id='.$_GET['id'].' listid='.$ezpid;//debug
        
    $active = ($_GET['id'] == $ezpid)? ' class="activeEZPage"''';
      }elseif(
    $alturl) {//check for current page in alturl
        
    echo ' url='.$_GET['url'].' alturl='.$alturl.' index='.strstr($alturl,'/index.php');//debug
        
    $active = ((strstr($_GET['url'],$alturl) and (strstr($alturl,'/index.php') != '/index.php')) or ($_GET['url'] == $alturl))?' class="activeILPage"''';
      }
      return 
    $active;
    }
    ?> 

 

 
Page 3 of 6 FirstFirst 12345 ... LastLast

Similar Threads

  1. v150 How to display Top Cat & Sub Cat but not Sub Sub Cats??
    By spiggles87 in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 5 Mar 2013, 06:37 PM
  2. Replies: 2
    Last Post: 31 Jul 2010, 03:43 PM
  3. Display top-level cat name in text, then sub-cat thumb
    By jfriesen in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 2 Feb 2007, 09:11 PM
  4. Master Cat's on main page, ONLY sub cat's on specific cat pages
    By wtashby in forum Setting Up Categories, Products, Attributes
    Replies: 0
    Last Post: 25 Jun 2006, 07:24 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