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?
Quote:
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?
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
Re: Disabling right column of template on page by page basis
Quote:
Originally Posted by
lat9
Okay I See that and that is helpful but where do I edit that in at?
Re: Disabling right column of template on page by page basis
Quote:
Originally Posted by
retched
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 :smile:
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?
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.
Re: Disabling right column of template on page by page basis
Quote:
Originally Posted by
retched
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. :smile: 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;
}
Re: Disabling right column of template on page by page basis
Re: Disabling right column of template on page by page basis
Is there a way to test for the category landing page?
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;
}