I would like to Hide the Information sidebox, except on:
index.php?main_page=page&id=2&chapter=0
How do I set up a conditional statement to check for this in information.php??
I would like to Hide the Information sidebox, except on:
index.php?main_page=page&id=2&chapter=0
How do I set up a conditional statement to check for this in information.php??
I too am looking for this solution.
Any help would be greatly appreciated!! Thanks.
Here is one way to do it; it may not be the best, but it appears to work.
If you put a conditional statement around the two requires at the bottom of information.php, then you can force it to display only on certain pages.
For example, in information.php there is:
-----
require($template->get_template_dir('tpl_information.php',DIR_WS_TEMPLATE, $current_page_base,'sideboxes'). '/tpl_information.php');
$title = BOX_HEADING_INFORMATION;
$title_link = false;
require($template->get_template_dir($column_box_default, DIR_WS_TEMPLATE, $current_page_base,'common') . '/' . $column_box_default);
-----
if you wrap this with a conditional, such as:
---
if( $_GET['main_page'] == 'page' && $_GET['id'] == '2' && $_GET['chapter'] == '0') {
require($template->get_template_dir('tpl_information.php',DIR_WS_TEMPLATE, $current_page_base,'sideboxes'). '/tpl_information.php');
$title = BOX_HEADING_INFORMATION;
$title_link = false;
require($template->get_template_dir($column_box_default, DIR_WS_TEMPLATE, $current_page_base,'common') . '/' . $column_box_default);
}
-----
you should see the information box only on that specific ez page. It appears to work for me. I'm sure there are other variables that could be tested that may be more reliable. Anybody got ideas on how to improve this conditional?
Thanks,
Steve
I cannot answer your question, but I'm also looking for a more generalized "conditional" sidebox. I've created by own sidebox which appears to work nicely. However, I don't want it shown all the time-- I have a variable I test. I can test for this inside the sidebox content, but that doesn't cover it's header.
Anyone have a more general place to conditionalize a sidebox visibility?
I used the CSS solution suggested by gjh42 in a related thread:
http://www.zen-cart.com/forum/showthread.php?t=75199
Add the last box of code from post#2 to your stylesheet and edit as needed. Works great for me and is very easy to implement!
Lisa
There is a detailed tutorial on the correct way to do this here:
https://www.zen-cart.com/tutorials/i...hp?article=270
--Regards,
Ken
What would be the correct syntax to accomplish this for
/index.php?main_page=product_info&products_id=4
I need a couple sidebox NOT to show on this page.![]()
Last edited by khopek; 17 Apr 2010 at 10:27 PM.
if (!($current_page_base == 'product_info' and $products_id == '4')) {
There are several possible minor variations on this.
Perfect, thanks for the quick response. I new the page would be product_info, but was not sure what the rest was.![]()
Bookmarks