Page 1 of 2 12 LastLast
Results 1 to 10 of 19
  1. #1
    Join Date
    Apr 2007
    Location
    Dayton, Ohio
    Posts
    682
    Plugin Contributions
    0

    Default Hide link in navigation bar.

    I am trying to display most top category links in the top navigation bar but hide 5 of them. Then in my left hand navigation box display (Better Categories) I want to hide the opposite categories.

    Please look at my template here: http://www.lasilhouettelingerie.com/...age=2&sort=20a

    My main categories are:
    Pleasure Objects, Hosiery, Accessories, Clothing, Lingerie, Swimwear, Sale, Shop by Category, Shop by Designer, Shop by Price, Shop by Color, Shop by Size

    On the top menu I want to hide all "shop by" menu items. Meaning my top category display would only show:
    Pleasure Objects, Hosiery, Accessories, Clothing, Lingerie, Swimwear, Sale

    On the left hand navigation block I want to display only these other 5 main categories:
    Shop by Category, Shop by Designer, Shop by Price, Shop by Color, Shop by Size

    I tried to install a module called: Hidden Categories (even though it was for version 1.3.9) to hide aspects of one of these menus, but it ran into difficulty with merging since this shared many of my files with my other plugins. Like: Ultimate SEO's, FEC, and My template files. There were too many files to merge and my PHP was getting jumbled. (I don't know much about PHP to begin with).

    Any ideas?

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

    Default Re: Hide link in navigation bar.

    http://www.zen-cart.com/showthread.p...e-category-tab

    I do have the files made up for a mod, but have not tested the package yet. If you want, I can zip them up and post for you to try.

    To hide the other categories in the sidebox, you can use Categories Dressing and make the ones you want to hide into one or more category groups, then hide those with CSS.

  3. #3
    Join Date
    Apr 2007
    Location
    Dayton, Ohio
    Posts
    682
    Plugin Contributions
    0

    Default Re: Hide link in navigation bar.

    Yes I think I would love the files for that mod please. I will test it to see if it works. Although, I may not be the best tester because I will just put it up there and see if it hides and/or shows. I know nothing about debugging.

    I thought that I could just put the EZ page menu up top (like I have on the bottom) and just manually create each catalog link using the URL feature in EZ pages to direct to the correct page. The problem with this, is that I would like to put a dynamic menu up there to show all the subcategories when hovered over. So if I can hide these few links, then I will search out the dynamic menu I am seeking.

    In the meantime, I am going to attempt your suggestions for hiding the side categories via Categories Dressing plugin.

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

    Default Re: Hide link in navigation bar.

    I attached the mod to the thread referenced before, so you can get it from there. It will not hide anything just by itself; you need to add rules to your stylesheet (duplicating/editing the ones given) to do the hiding for the particular categories.

  5. #5
    Join Date
    Apr 2007
    Location
    Dayton, Ohio
    Posts
    682
    Plugin Contributions
    0

    Default Re: Hide link in navigation bar.

    Thank you I posted in the forum with the Mod providing feedback. It's running great!

  6. #6
    Join Date
    Apr 2007
    Location
    Dayton, Ohio
    Posts
    682
    Plugin Contributions
    0

    Default Re: Hide link in navigation bar.

    gjh42,

    First you done a wonderful job on this module you provided. I am sorry to bring this up, but I thought I would ask. What I am talking about is, if possible, I would like to implement your: "Category Tab Dressing v10 - Beta" into "Category Tab Simple Dropdown Menu v.1.3.9a" Since there were only a few files for both (and one of them shared), I thought I might be able to do this easily.

    I tried many things, but I do not know php. What I ended up with was merging the shared files together into one page, in an effort to get the dynamic drop down menu and hide the 5 "shop by" categories. It doesn't seem to be working for me.

    Right now I have both menus loaded onto my site you can see it here: http://www.lasilhouettelingerie.com/...hosiery-c-141/ I really love the dynamic drop-down, but I also have to hide 5 categories somehow.

    Is there a fairly simple merge possible?

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

    Default Re: Hide link in navigation bar.

    It should be simple, as there are only about three lines in two files modified for this. Which file do they share?

  8. #8
    Join Date
    Apr 2007
    Location
    Dayton, Ohio
    Posts
    682
    Plugin Contributions
    0

    Default Re: Hide link in navigation bar.

    Quote Originally Posted by gjh42 View Post
    It should be simple, as there are only about three lines in two files modified for this. Which file do they share?
    They both share tpl_modules_categories_tabs.php in the ../templates/MYTEMPLATE/templates folder. Below I have posted both shared files (tpl_categories_tabs.php) for the prospective plugins.

    As you know, in the module: "Category Tab Dressing v10 - Beta" you created this code which hides the links:

    Code:
    <?php
    /**
     * Module Template - categories_tabs
     *
     * Template stub used to display categories-tabs output
     *
     * @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_modules_categories_tabs.php 3395 2006-04-08 21:13:00Z ajeh $
     * modified for Categories-Tabs Dressing by Glenn Herbert (gjh42) 2012-11-09  (line 22)
     */
    
      include(DIR_WS_MODULES . zen_get_module_directory(FILENAME_CATEGORIES_TABS));
    ?>
    <?php if (CATEGORIES_TABS_STATUS == '1' && sizeof($links_list) >= 1) { ?>
    <div id="navCatTabsWrapper">
    <div id="navCatTabs">
    <ul>
    <?php for ($i=0, $n=sizeof($links_list); $i<$n; $i++) { ?>
      <li class="<?php echo substr($links_list[$i], 23, (strpos($links_list[$i], '" hr', $links_list[$i]) - 23));?>"><?php echo $links_list[$i];?></li>
    <?php } ?>
    </ul>
    </div>
    </div>
    <?php } ?>
    And in the module: "Category Tab Simple Dropdown Menu v.1.3.9a" we have this code which provides the dynamic drop-down menus (and a few css definitions elsewhere):

    Code:
    <?php
    /**
     * Module Template - categories_tabs with dropdown product menus
     *
     * Template stub used to display categories-tabs output
     *
     * @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_modules_categories_tabs.php 3395 2011-06-10 21:13:00Z dbltoe $
     */
    ?>
    <?php
    if (CATEGORIES_TABS_STATUS == '1') 
    {
        echo '<div id="navCatTabsWrapper">';
        echo '<div id="navCatTabsDropdown">';
        echo '<ul>';
    
        $categories_tab_query = "SELECT c.categories_id, cd.categories_name FROM ".TABLE_CATEGORIES." c, ".TABLE_CATEGORIES_DESCRIPTION . " cd WHERE c.categories_id=cd.categories_id AND c.parent_id= '0' AND cd.language_id='" . (int)$_SESSION['languages_id'] . "' AND c.categories_status='1' ORDER BY c.sort_order, cd.categories_name;";
        $categories_tab = $db->Execute($categories_tab_query);
    
        while (!$categories_tab->EOF) 
        {
        // currently selected category
            echo '<li>';
            echo '<a class="category-top" href="'.zen_href_link(FILENAME_DEFAULT,'cPath=' . (int)$categories_tab->fields['categories_id']).'">'; 
            if((int)$cPath == $categories_tab->fields['categories_id']) 
             echo '<span class="category-subs-selected">'.$categories_tab->fields['categories_name'].'</span>';
            else 
             echo $categories_tab->fields['categories_name'];
    
            echo '</a>';
            $subcategories_tab_query="SELECT c.categories_id, cd.categories_name FROM ".TABLE_CATEGORIES." c, ".TABLE_CATEGORIES_DESCRIPTION . " cd WHERE c.categories_id=cd.categories_id AND c.parent_id= '".(int)$categories_tab->fields['categories_id']."' AND cd.language_id='" . (int)$_SESSION['languages_id'] . "' AND c.categories_status='1' ORDER BY c.sort_order, cd.categories_name;";
            $subcategories_tab=$db->Execute($subcategories_tab_query);
            if($subcategories_tab->RecordCount()>0)
            {
                echo '<ul>';
                while (!$subcategories_tab->EOF) 
                {
                    $cPath_new=zen_get_path($subcategories_tab->fields['categories_id']);
                    $cPath_new=str_replace('=0_', '=', $cPath_new);
                    $cPath_new="cPath=".$subcategories_tab->fields['categories_id'];
                    echo '<li>'.'<a href="' . zen_href_link(FILENAME_DEFAULT, $cPath_new) . '">'.$subcategories_tab->fields['categories_name'].'</a></li>';
                    $subcategories_tab->MoveNext();
                }
                echo '</ul>';
            }
            $products_tab_query="SELECT p.`products_id`, pd.`products_name`, pd.`language_id` FROM ".TABLE_PRODUCTS." p, ".TABLE_PRODUCTS_DESCRIPTION." pd WHERE p.`master_categories_id`='".(int)$categories_tab->fields['categories_id']."' AND p.`products_id`=pd.`products_id` AND p.products_status='1' AND pd.`language_id`='".(int)$_SESSION['languages_id']."' ORDER BY p.`products_sort_order`;";
            $products_tab=$db->Execute($products_tab_query);
            if($products_tab->RecordCount()>0)
            {
                echo '<ul>';
                while (!$products_tab->EOF) 
                {    
                    $cPath_new=zen_get_path($categories->fields['categories_id']);
                    $cPath_new=str_replace('=0_', '=', $cPath_new);
                    echo '<li>'.'<a href="'.zen_href_link(zen_get_info_page($products_tab->fields['products_id']),$cPath_new. '&products_id=' . $products_tab->fields['products_id']) . '">'.$products_tab->fields['products_name'].'</a></li>';
                    $products_tab->MoveNext();
                }
                echo '</ul>';
            }
            echo '</li>';
            $categories_tab->MoveNext();
        }
        echo '</ul>';
        echo '</div>';
        echo '</div>';
    }
    ?>
    I tried to merge both files by putting all the code, but both menus showed instead of a merge. As you know the: "Category Tab Dressing v10 - Beta" also has the includes/modules/MYTEMPLATE/categories_tabs.php file as well. If this can be done it would be awesome!
    Last edited by sports guy; 19 Nov 2012 at 05:25 PM. Reason: made it more readable

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

    Default Re: Hide link in navigation bar.

    <li class="<?php echo substr($links_list[$i], 23, (strpos($links_list[$i], '" hr', $links_list[$i]) - 23));?>"><?php echo $links_list[$i];?></li>
    This part of the simple dropdown file needs to be edited to add the class tag to the <li>:
    PHP Code:
        while (!$categories_tab->EOF
        {
        
    // currently selected category
            
    echo '<li>'
    PHP Code:
        while (!$categories_tab->EOF) 
        {
        // currently selected category
            echo '<li class="<?php echo substr($links_list[$i], 23, (strpos($links_list[$i], '" hr'$links_list[$i]) - 23));?>">';
    This should work as long as the simple dropdown does not alter how $links_list is built, and lets the cat-tabs dressing do it.

  10. #10
    Join Date
    Apr 2007
    Location
    Dayton, Ohio
    Posts
    682
    Plugin Contributions
    0

    Default Re: Hide link in navigation bar.

    Glen please forgive me for being ignorant, I am getting many PHP syntax errors in dreamweaver.

    In my dynamic drop-down file, I took this code:
    Code:
    while (!$categories_tab->EOF) 
        {
        // currently selected category
            echo '<li>';
    and changed it to this:
    Code:
    while (!$categories_tab->EOF)  
        { 
        // currently selected category 
            echo '<li class="<?php echo substr($links_list[$i], 23, (strpos($links_list[$i], '" hr', $links_list[$i]) - 23));?>">';
    as you suggested. But almost every other line below this registered errors in Dreamweaver.

    Now with the next few lines it looks like this:

    Code:
    while (!$categories_tab->EOF) 
        {
        // currently selected category
            echo '<li class="<?php echo substr($links_list[$i], 23, (strpos($links_list[$i], '" hr', $links_list[$i]) - 23));?>">';
            echo '<a class="category-top" href="'.zen_href_link(FILENAME_DEFAULT,'cPath=' . (int)$categories_tab->fields['categories_id']).'">'; 
            if((int)$cPath == $categories_tab->fields['categories_id']) 
             echo '<span class="category-subs-selected">'.$categories_tab->fields['categories_name'].'</span>';
            else 
             echo $categories_tab->fields['categories_name'];
    
            echo '</a>';
    Is there an issue with syntax above? There are approximately 20 lines below this now with red error coding. I don't know my symbols but I suspect one of the symbols above may be wrong?
    Last edited by sports guy; 19 Nov 2012 at 11:41 PM.

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. Navigation Bar Link Show /#
    By chinelly in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 18 Jul 2011, 05:18 AM
  2. Hide a navigation link
    By chris21 in forum General Questions
    Replies: 5
    Last Post: 17 Jul 2011, 11:06 AM
  3. add link to navigation bar
    By herosunfun in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 18 Oct 2010, 11:06 PM
  4. How to create New Link in Top Navigation Bar
    By layoyo in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 21 Oct 2008, 08:56 PM
  5. Languagues Link on Navigation Bar
    By layoyo in forum Templates, Stylesheets, Page Layout
    Replies: 0
    Last Post: 15 Oct 2008, 10:01 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