Results 1 to 9 of 9
  1. #1
    Join Date
    Feb 2010
    Posts
    2,159
    Plugin Contributions
    17

    Default Disable Right Column from index&cPath only

    I am trying to disable the right column from product listing pages (index&cPath).

    This is what I am doing:

    I have inserted the following code in /includes/templates/CUSTOM_TEMPLATE/common/tpl_main_page.php

    if (in_array($cPath,explode(",",'1,2,3,4,5')) ) {
    $flag_disable_right = true;

    this works great, however I have 18 top level categories & 700 sub-categories.

    My question is, is their a way to disable all the cPath extensions without manually inserting them?

  2. #2
    Join Date
    Feb 2010
    Posts
    2,159
    Plugin Contributions
    17

    Default Re: Disable Right Column from index&cPath only

    it was tricky and don't make much sense but this is the (codes) I used:

    if ($_GET['main_page'] == 'index') {
    $flag_disable_right = true;
    } else {
    $flag_disable_right = false;
    }

    if ($this_is_home_page) {
    $flag_disable_right = false;
    }

    if (in_array($current_page_base,explode(",",'products_new,advanced_search_result,pr oducts_all,shopping_cart')) ) {
    $flag_disable_right = true;
    }

  3. #3
    Join Date
    Aug 2009
    Posts
    210
    Plugin Contributions
    1

    Default Re: Disable Right Column from index&cPath only

    I know this is a delayed response but in case someone else runs upon this post..

    In this case I would just put $flag_disable_right = true or left on the view page in the templates/templates folder.

  4. #4
    Join Date
    Feb 2010
    Posts
    2,159
    Plugin Contributions
    17

    Default Re: Disable Right Column from index&cPath only

    I am trying to disable the right column from product listing pages (index&cPath).

    rbarbour
    index&cPath is used to display all categories and sub-categories (same page) so the only way to disable("right or left") column $flag_disable_right or $flag_disable_left

    for 1 individual category or sub-category page would be to insert
    PHP Code:
    if (in_array($cPath,explode(",",'1,2,3,4,5')) ) {
    $flag_disable_right true
    into your /includes/templates/CUSTOM_TEMPLATE/common/tpl_main_page.php

    but to disable("right or left") column on all categories and sub-categories you would have to insert
    PHP Code:
    if ($current_page_base == 'index' and $cPath 0) {
      
    $flag_disable_right true;

    above code is different than earlier used code as I have been cleaning up my files.

    I have never inserted the $flag_disable_right = true; on individual pages, always inserted in tpl_main_page.php

    for pages within your shop you insert the following code in tpl_main_page.php
    PHP Code:
    if (in_array($current_page_base,explode(",",'products_new,advanced_search_result,products_all,shopping_cart')) ) {
    $flag_disable_right true;

    I hope this helps!

  5. #5
    Join Date
    Nov 2005
    Location
    Colorado Springs, CO USA
    Posts
    7,033
    Plugin Contributions
    31

    Default Re: Disable Right Column from index&cPath only

    Quote Originally Posted by rbarbour View Post
    I am trying to disable the right column from product listing pages (index&cPath).

    This is what I am doing:

    I have inserted the following code in /includes/templates/CUSTOM_TEMPLATE/common/tpl_main_page.php

    if (in_array($cPath,explode(",",'1,2,3,4,5')) ) {
    $flag_disable_right = true;

    this works great, however I have 18 top level categories & 700 sub-categories.

    My question is, is their a way to disable all the cPath extensions without manually inserting them?
    You could also use the following:

    if ($current_page_base == 'index' and $cPath > '0' ) {
    $flag_disable_right = true;
    }

  6. #6
    Join Date
    Jun 2007
    Location
    Michigan
    Posts
    187
    Plugin Contributions
    0

    Default Re: Disable Right Column from index&cPath only

    I just tried using this and it didn't work for me.

    This is suppose to disable the right column in the store, right?
    Even the subcatagories?

    I'm currently using this file for my product listing that works:
    if ($current_page_base == 'index' and $cPath == '65') {
    $flag_disable_right = true;
    }


    But it doesn't work on my subcatagory's page....
    I'm at a lost because i want my subcatagories to disable right too, but they're just too many to manually plug in.

    Quote Originally Posted by clydejones View Post
    You could also use the following:

    if ($current_page_base == 'index' and $cPath > '0' ) {
    $flag_disable_right = true;
    }
    Last edited by ljdream00; 22 Mar 2011 at 06:50 AM. Reason: more explaination

  7. #7
    Join Date
    Jun 2007
    Location
    Michigan
    Posts
    187
    Plugin Contributions
    0

    Default Re: Disable Right Column from index&cPath only

    please slap me.....

    for some reason my mind has acted like I've never used zencart before.... I see the error now, of course it was "user error"....


    Quote Originally Posted by ljdream00 View Post
    I just tried using this and it didn't work for me.

    This is suppose to disable the right column in the store, right?
    Even the subcatagories?

    I'm currently using this file for my product listing that works:
    if ($current_page_base == 'index' and $cPath == '65') {
    $flag_disable_right = true;
    }


    But it doesn't work on my subcatagory's page....
    I'm at a lost because i want my subcatagories to disable right too, but they're just too many to manually plug in.

  8. #8
    Join Date
    Feb 2011
    Location
    Indianapolis, IN
    Posts
    38
    Plugin Contributions
    0

    Default Re: Disable Right Column from index&cPath only

    I asked the same question today and received a different although functional answer. Not sure which is better, choose your own adventure I say:

    http://www.zen-cart.com/forum/showthread.php?t=177805

    Good luck, and thanks to gjh42.

    JJ
    www.tuxedoparkbrewers.com
    Zen Cart 1.3.9h

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

    Default Re: Disable Right Column from index&cPath only

    For many of these situations there are several valid ways to do the job, and the "best" is the one you can understand and maintain and which takes the least processing to execute... often a tossup.

 

 

Similar Threads

  1. v151 disable right column only in Category page
    By asdfwen in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 21 Jun 2013, 04:52 AM
  2. v151 Add To Cart From Product Details index&cPath Issue
    By jbible in forum General Questions
    Replies: 7
    Last Post: 14 Jan 2013, 04:10 PM
  3. How to add banner to index.php?main_page=index&cPath=0 ?
    By Alexiss in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 31 Oct 2011, 04:55 PM
  4. Category Images displayed in link /index.php?=index&cPath=0
    By shadowd in forum Templates, Stylesheets, Page Layout
    Replies: 2
    Last Post: 5 Feb 2010, 09:16 PM
  5. disable right column background only on product_info
    By gsdcypher in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 13 May 2009, 12:09 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