Page 1 of 2 12 LastLast
Results 1 to 10 of 12
  1. #1
    Join Date
    Jun 2007
    Location
    Bronx, New York, United States
    Posts
    521
    Plugin Contributions
    3

    Default Disabling right column of template on page by page basis

    Going over the documentation , I would like to know how can I configure ZenCart to only show the right column if it is on certain pages?

    Column Left Status - Global
    Show Column Left, unless page override exists?
    0= Column Left is always off
    1= Column Left is on, unless page override
    How do I access these overrides?

  2. #2
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    12,478
    Plugin Contributions
    88

    Default Re: Disabling right column of template on page by page basis

    Scrolling down to view "Similar Threads" yielded this which might help: http://www.zen-cart.com/showthread.p...o_display-page

  3. #3
    Join Date
    Jun 2007
    Location
    Bronx, New York, United States
    Posts
    521
    Plugin Contributions
    3

    Default Re: Disabling right column of template on page by page basis

    Quote Originally Posted by lat9 View Post
    Scrolling down to view "Similar Threads" yielded this which might help: http://www.zen-cart.com/showthread.p...o_display-page
    Okay I See that and that is helpful but where do I edit that in at?

  4. #4
    Join Date
    Oct 2008
    Location
    Croatia
    Posts
    1,542
    Plugin Contributions
    19

    Default Re: Disabling right column of template on page by page basis

    Quote Originally Posted by retched View Post
    Okay I See that and that is helpful but where do I edit that in at?
    Take a look at includes/templates/YOUR_TEMPLATE/common/tpl_main_page.php - everything is explained in the very beginning of the file, plus the first active line says it all.

    Code:
    if (in_array($current_page_base,explode(",",'list_pages_to_skip_all_right_sideboxes_on_here,separated_by_commas,and_no_spaces')) ) {
        $flag_disable_right = true;
      }
    So, if you want to disable it on shopping cart page, product page and new products page, you'll have something like this:
    Code:
    if (in_array($current_page_base,explode(",",'shopping_cart,product_info,products_new')) ) {
        $flag_disable_right = true;
      }
    If you want to disable the left column, you'll just copy these lines and change $flag_disable_right to $flag_disable_left. If you're not sure what's the page name, take a peek in includes/modules/pages

  5. #5
    Join Date
    Jun 2007
    Location
    Bronx, New York, United States
    Posts
    521
    Plugin Contributions
    3

    Default Re: Disabling right column of template on page by page basis

    Thanks for the info. I'm able to get the pages to work fine but I have one SMALL problem. when I use the following code:

    PHP Code:
      if (in_array($current_page_base,explode(",",'index,product_cfvsingles_info,product_info')) ) {
        
    $flag_disable_right true;
      } 
    It disables it on the home page, product info pages (a custom type and default). Which is what I want. But when you load up a category page, it disables that too. How can I express to allow the page to show on the category page but NOT the index page?

  6. #6
    Join Date
    Jun 2007
    Location
    Bronx, New York, United States
    Posts
    521
    Plugin Contributions
    3

    Default Re: Disabling right column of template on page by page basis

    Nevermind I figured it out. This is a patch job but should do the trick:

    if (in_array($current_page_base,explode(",",'product_cfvsingles_info,product_info') ) || (in_array($current_page_base,"index") && $_GET['cPath'] != '')) {
    $flag_disable_right = true;
    }

    The above interprets as (I hope):

    If in the current_page_base array, I find "product_cfvsingles_info OR product_info OR if in the array current_page_base, I find "index" AND the cPath variable does not equal blank, do not shot the right column.

    At least if I did it right. If there's a better way, feel free to write.

  7. #7
    Join Date
    Oct 2008
    Location
    Croatia
    Posts
    1,542
    Plugin Contributions
    19

    Default Re: Disabling right column of template on page by page basis

    Quote Originally Posted by retched View Post
    Nevermind I figured it out. This is a patch job but should do the trick:

    if (in_array($current_page_base,explode(",",'product_cfvsingles_info,product_info') ) || (in_array($current_page_base,"index") && $_GET['cPath'] != '')) {
    $flag_disable_right = true;
    }

    The above interprets as (I hope):

    If in the current_page_base array, I find "product_cfvsingles_info OR product_info OR if in the array current_page_base, I find "index" AND the cPath variable does not equal blank, do not shot the right column.

    At least if I did it right. If there's a better way, feel free to write.
    Actually, there is a better way. There is a native check for home page ($this_is_home_page) so you should use that where ever applicable.
    Code:
    if (in_array($current_page_base,explode(",",'product_cfvsingles_info,product_info') ) || $this_is_home_page) {
    $flag_disable_right = true;
    }

  8. #8
    Join Date
    Dec 2012
    Posts
    607
    Plugin Contributions
    0

    Default Re: Disabling right column of template on page by page basis

    Great topic. Thanks.
    Using Zen Cart 1.5.1

  9. #9
    Join Date
    Jun 2007
    Location
    Bronx, New York, United States
    Posts
    521
    Plugin Contributions
    3

    Default Re: Disabling right column of template on page by page basis

    Is there a way to test for the category landing page?

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

    Default Re: Disabling right column of template on page by page basis

    If by that you mean a particular category page (whether the category is listing subcats or products), you could use for the category where cPath=2_13
    PHP Code:
    if ($current_page_base == 'index' and $cPath == '2_13') {
      
    $flag_disable_left true;


 

 
Page 1 of 2 12 LastLast

Similar Threads

  1. Replies: 5
    Last Post: 30 May 2014, 02:43 AM
  2. Enabling/disabling left column based upon page ID
    By bobmeetin in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 11 Apr 2013, 05:34 PM
  3. Replies: 1
    Last Post: 29 Dec 2011, 03:31 PM
  4. Replies: 14
    Last Post: 20 Oct 2010, 10:43 PM
  5. Adding a Right Column to single column template
    By Delights in forum Templates, Stylesheets, Page Layout
    Replies: 7
    Last Post: 7 Sep 2010, 11:22 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