Page 1 of 2 12 LastLast
Results 1 to 10 of 11
  1. #1
    Join Date
    Dec 2009
    Posts
    19
    Plugin Contributions
    0

    Default Remove Subcategories Listing Page

    I have search and haven't found the answer. I seems very simple but I am stumped. I would like users to be able to click on a category and go straight to all the listings in that category eliminating the subcategories page.

  2. #2

    Default Re: Remove Subcategories Listing Page

    bump... i want to know, too!

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

    Default Re: Remove Subcategories Listing Page

    Then why do you have subcategories in that category?

  4. #4

    Default Re: Remove Subcategories Listing Page

    i'm using the css dropdown menu, and want to force people to choose subcategories there. i don't want to have the option to click on the main category name to bring you to the subcategory listing pages at all. would appreciate any help - this is making me crazy!

    maybe my issue is a little different from the original poster.....

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

    Default Re: Remove Subcategories Listing Page

    OK, so what you want is essentially to make the top category buttons in the dropdown to be not links. That should be possible with some logic added to tpl_drop_menu.php (I think that's the file). I can take a look at it, but it may be a few days before I have time to get into it.

  6. #6

    Default Re: Remove Subcategories Listing Page

    that's exactly it - you stated it much more eloquently than i did!

    i truly do appreciate any help. as i said, this has been totally driving me crazy!

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

    Default Re: Remove Subcategories Listing Page

    There are at least a couple of dropdown menu mods in Free Addons, so I would need to know exactly which one you are using before trying to modify files.

  8. #8

    Default Re: Remove Subcategories Listing Page


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

    Default Re: Remove Subcategories Listing Page

    tpl_drop_menu.php just calls /includes/classes/categories_ul_generator.php, and applies a few cryptic transformations to its output (for the categories part of the menu). It might be possible to intercept and alter the right one of those, but more likely the class will have to be edited. I would suggest you check with Jade (jettrue) in the support thread about this. Meanwhile, I'll take a look at it, but I make no promises for quick results.

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

    Default Re: Remove Subcategories Listing Page

    PHP Code:
        function buildBranch($parent_id$level$submenu=true$parent_link='')
        {
            
    $result sprintf($this->parent_group_start_string, ($submenu==true) ? ' class="level'. ($level+1) . '"' '' );
            
            if ((
    $this->data[$parent_id])) {
                foreach(
    $this->data[$parent_id] as $category_id => $category) {
                    
    $category_link $parent_link $category_id;
                    if ((
    $this->data[$category_id])) {
                        
    $result .= sprintf($this->child_start_string, ($submenu==true) ? ' class="submenu"' '');
                    } else {
                        
    $result .= sprintf($this->child_start_string'');
                    }
                    
    //$result .= str_repeat($this->spacer_string, $this->spacer_multiplier * 1) . '<a href="' . zen_href_link(FILENAME_DEFAULT, 'cPath=' . $category_link) . '">';
                    
    $result .= str_repeat($this->spacer_string$this->spacer_multiplier 1) . ($parent_link'<a href="' zen_href_link(FILENAME_DEFAULT'cPath=' $category_link) . '">''');
                    
    $result .= $category['name'];
                    
    //$result .= '</a>';
                    
    $result .= ($parent_link'</a>''');
                      
                    if ((
    $this->data[$category_id]) && (($this->max_level == '0') || ($this->max_level $level+1))) {
                        
    $result .= $this->buildBranch($category_id$level+1$submenu$category_link '_');
                    }
                    
    $result .= $this->child_end_string;
                }
            }
            
            
    $result .= $this->parent_group_end_string;
            return 
    $result;
        } 
    Add as shown in red to two lines:
    ($parent_link? '<a href="' . zen_href_link(FILENAME_DEFAULT, 'cPath=' . $category_link) . '">': '')
    ($parent_link? '</a>': '')

    This will disable the link if $parent_link is blank (the current category is a top category).

    Please test and let me know how it works for you. If you have sub-subcats, this would not disable links on their parents (subcats). That would require a different approach, but might be achievable without much more complexity.

 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. Can't view subcategories on page & Want to remove # of products next to category!!!
    By j.lamboy in forum Setting Up Categories, Products, Attributes
    Replies: 3
    Last Post: 3 Oct 2009, 03:26 PM
  2. Subcategories links will not remove from main page
    By Aplus Shoes in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 27 Sep 2009, 08:07 PM
  3. Replies: 4
    Last Post: 20 Nov 2008, 07:23 AM
  4. Listing X number of subcategories per page
    By frostbite7217 in forum Setting Up Categories, Products, Attributes
    Replies: 0
    Last Post: 17 Sep 2007, 08:16 PM
  5. Subcategories & sub-subcategories page links are stacking
    By METOOTECH in forum General Questions
    Replies: 2
    Last Post: 16 May 2007, 03:35 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