Results 1 to 7 of 7
  1. #1
    Join Date
    Aug 2006
    Location
    Singapore
    Posts
    167
    Plugin Contributions
    1

    Default IF statement to turn off left/right column on category page

    Hi all..

    I tried to insert an IF statement in tpl_main_page.php so that I can turn off different left or right column combination in category and subcategory page.... I also need this IF statement for other purpose.


    - Category page, i.e www.mysite.com/index.php?main_page=index&cPath=1
    I need to turn off left column, turn on right column on this page

    - Sub-category page, i.e http://www.mysite.com/index.php?main...dex&cPath=1_10
    I need to turn on left column, turn off right column on this page


    I tried the following codes:


    if ($current_page=='index' && (int)$cPath>0) {
    $flag_disable_left = true;
    }

    if ($current_page=='index' && $cPath>0 && (int)cPath_array>0) {
    $flag_disable_right = true;
    }

    Anyhow the 2nd if statement didn't work for sub-category page. 1st if statement works.

    Please Zenner help me out.... thanks!

  2. #2
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: IF statement to turn off left/right column on category page

    You could use:
    $current_category_id

    for the immediate categories_id ...
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  3. #3
    Join Date
    Aug 2006
    Location
    Singapore
    Posts
    167
    Plugin Contributions
    1

    Default Re: IF statement to turn off left/right column on category page

    Hi Linda,

    Thanks for the codes, it works for immediate category id, anyhow I would like the code for the whole category page and also another statement for sub-category page.

    i.e for sub-cat ../index.php?main_page=index&cPath=x_xx

    might be ../index.php?main_page=index&cPath=x_xx_xx or sub-sub-cat page.

    x_xx could be any category/sub-cat pages, so I would like to turn off right column in all sub-cat or sub-sub-cat page, while in category page I would like to turn off left column only.

    Many thanks for help!

  4. #4
    Join Date
    Sep 2003
    Location
    Ohio
    Posts
    69,402
    Plugin Contributions
    6

    Default Re: IF statement to turn off left/right column on category page

    Stick this at the top of your tpl_header.php and navigate through your categories to get a better feel for how these work ...

    Note: when you are looking via Manufacture's sidebox and pick a category it with be $_GET['filter_id'] being used ...
    Linda McGrath
    If you have to think ... you haven't been zenned ...

    Did YOU buy the Zen Cart Team a cup of coffee and a donut today? Just click here to support the Zen Cart Team!!

    Are you using the latest? Perhaps you've a problem that's fixed in the latest version: [Upgrade today!]
    Officially PayPal-Certified! Just click here

    Try our Zen Cart Recommended Services - Hosting, Payment and more ...
    Signup for our Announcements Forums to stay up to date on important changes and updates!

  5. #5
    Join Date
    Aug 2006
    Location
    Singapore
    Posts
    167
    Plugin Contributions
    1

    Default Re: IF statement to turn off left/right column on category page

    Hi Linda,

    I'm not sure what you meant by Manufacturer's sidebox?
    Perhaps you were replying to other's thread?

  6. #6
    Join Date
    Aug 2006
    Location
    Singapore
    Posts
    167
    Plugin Contributions
    1

    Default Re: IF statement to turn off left/right column on category page

    Still can't crack this...any help really appreciated.

    Thanks

  7. #7
    Join Date
    Aug 2006
    Location
    Singapore
    Posts
    167
    Plugin Contributions
    1

    Default Re: IF statement to turn off left/right column on category page

    Anyone can help me with the IF statement to:

    - turn off left column only in category page
    - turn off right column only in sub-category page (as well as sub-sub-category page)

    Thanks!

 

 

Similar Threads

  1. v151 How to turn off left column for one category and all of its sub categories?
    By WayneStephens in forum Templates, Stylesheets, Page Layout
    Replies: 9
    Last Post: 8 Jul 2016, 07:50 PM
  2. Turn off right and left columns front page only
    By cshart in forum Templates, Stylesheets, Page Layout
    Replies: 8
    Last Post: 24 Dec 2010, 04:24 AM
  3. Possible to turn off left & right columns based on page type?
    By edwardtilbury in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 17 Mar 2009, 04:33 AM
  4. Turn off right column in home page only
    By KiwiBrian in forum Templates, Stylesheets, Page Layout
    Replies: 7
    Last Post: 23 Jul 2008, 08:18 PM
  5. Turn off left/right column for certain pages
    By Berserker in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 27 Feb 2008, 02:55 AM

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