Results 1 to 8 of 8

Hybrid View

  1. #1
    Join Date
    Jun 2010
    Posts
    32
    Plugin Contributions
    0

    Default Can I disable right sidebar when on a cat page which has subcats?

    I would like my right hand side bar to NOT show up when you are on a category page which lists sub categories.

    I currently am able to hide the sidebox on the index page using:
    Code:
     if ($this_is_home_page == true) { 
    $flag_disable_right = true;
    $flag_disable_left = false;
    }
    I have been trying to hide subcats using this code:
    Code:
    // the following IF statement can be duplicated/modified as needed to set additional flags
    if ($current_page_base == 'cPath=175') {
         $flag_disable_right = true;
      }
    But it's not hiding them.

    Any help would be greatly appreciated!

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

    Default Re: How to disable right sidebar when on a cat page which has subcats?

    The test code you show will never work. $current_page_base will never be a cPath, and tests for a cPath need to use the numeric part (possibly including underscores) without cPath=.

    You can use ($current_page_base == 'index' and $cPath == '175') which will apply only to a listing of category 175. This will not be based on whether it holds categories or products, though.

    Do you want to affect only certain categories, or just all categories that have or will have subcats?
    Unfortunately subcategory listings and product listings are both 'index' pages.

  3. #3
    Join Date
    Jun 2010
    Posts
    32
    Plugin Contributions
    0

    Default Re: How to disable right sidebar when on a cat page which has subcats?

    Quote Originally Posted by gjh42 View Post
    The test code you show will never work. $current_page_base will never be a cPath, and tests for a cPath need to use the numeric part (possibly including underscores) without cPath=.

    You can use ($current_page_base == 'index' and $cPath == '175') which will apply only to a listing of category 175. This will not be based on whether it holds categories or products, though.

    Do you want to affect only certain categories, or just all categories that have or will have subcats?
    Unfortunately subcategory listings and product listings are both 'index' pages.
    I would be happy manually setting them for each category page I wish to hide.

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

    Default Re: How to disable right sidebar when on a cat page which has subcats?

    Then you can use

    if ($current_page_base == 'index' and in_array($cPath, explode(',', '175,189,213,345_7788,666,501'))) {

    listing all the cPaths separated by commas, with no spaces.

  5. #5
    Join Date
    Jun 2010
    Posts
    32
    Plugin Contributions
    0

    Default Re: How to disable right sidebar when on a cat page which has subcats?

    Quote Originally Posted by gjh42 View Post
    Then you can use

    if ($current_page_base == 'index' and in_array($cPath, explode(',', '175,189,213,345_7788,666,501'))) {

    listing all the cPaths separated by commas, with no spaces.
    This is the code I've entered:
    HTML Code:
    if ($current_page_base == 'index' and in_array($cPath, explode(',', '175,174'))) {
         $flag_disable_right = true;
      }
    and I have put this code into my tpl_index_default.php in my overrides folder, however the sideboxes are still showing up on the 2 categories I entered (174, and 175)

  6. #6
    Join Date
    Jan 2007
    Location
    Mount Maunganui, New Zealand
    Posts
    419
    Plugin Contributions
    0

    Default Re: How to disable right sidebar when on a cat page which has subcats?

    If I'd like to hide the right column from all, except home page, ezpages and say one category (id 7)
    How would I code that?
    Thanks

 

 

Similar Threads

  1. Category Sidebox keep Parent Cat/Subcats open?
    By mteipe in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 4 Aug 2010, 12:47 AM
  2. How can I show products on Cat with subCats page
    By bumba000 in forum General Questions
    Replies: 2
    Last Post: 12 Jan 2008, 10:23 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