Ah ok, in that case you would wrap the test around all of the executable code in the categories.php and testimonials.php module files, or possibly the tpl_ files, I don't recall which at the moment (check on their exact names).
Yes (post 62), categories.php and testimonials.php.
Would the executable code be:
For includes/modules/sideboxes/my_template/testimonials.phprequire ($template->get_template_dir('tpl_testimonials.php', DIR_WS_TEMPLATE, $current_page_base, 'sideboxes'). '/tpl_testimonials.php');
require ($template->get_template_dir($column_box_default, DIR_WS_TEMPLATE, $current_page_base, 'common') . '/' . $column_box_default);
and:
For includes/modules/sideboxes/my_template/categories.phprequire($template->get_template_dir('tpl_categories.php',DIR_WS_TEMPLATE, $current_page_base,'sideboxes'). '/tpl_categories.php');
$title = BOX_HEADING_CATEGORIES;
$title_link = false;
require($template->get_template_dir($column_box_default, DIR_WS_TEMPLATE, $current_page_base,'common') . '/' . $column_box_default);
}
If so I rapped this bit of code around them:
but it didn't work.if(in_array($_GET['main_page'],explode(',','about_cool_tech,cool_tech_values,inside_cool_tech,giving_back,thin k_green,tech_support,discount-coupon'))){
}
I am somewhat confused with coding as I go through this thread.
My goal is to hide certain sideboxes from the product pages. But, do not see sideboxes for them. Sideboxes to hide: newsletter, links, testimonials, and About Us.
Which file? I think this may be code? Where should it go in file at?
Thanks, KimHTML Code:if (in_array($current_page_base, explode(',','about_cool_tech,cool_tech_values,inside_cool_tech,giving_back,think_green,tech_support,discount-coupon'))){ //skip these pages } else { //...execute the code }
I want to hide certain sideboxes from product pages or basically keep only on main page. I went to includes/template/my temp/common/tpl_main_page. I added this code to keep only on main page for links side box, newsletter side box(subscribe), testimonials side box and About Us (ezpages).
$main_page_only = array('testimonials-manager','subscribe','linksbox','ezpages');
if (in_array($current_page_base,$main_page_only) ) {
$flag_disable_right = true;
$flag_disable_left = true;
}
I still can not get it to work.
If you really want those sideboxes only on the home page, useor to target just those pagesPHP Code:
if (!$this_is_home_page){
$flag_disable_left = true;
$flag_disable_right = true;
}
I know this should be equivalent to the test you posted, but I have successfully used this version many times.PHP Code:
if (in_array($current_page_base, explode(',','testimonials-manager,subscribe,linksbox,ezpages'))){
$flag_disable_left = true;
$flag_disable_right = true;
}
Just curious ... are you trying to turn off individual sideboxes or are you trying to turn off columns?
These variables and their values:
$flag_disable_left = true;
$flag_disable_right = true;
are used to control the left and right columns ... and, when placed correctly in the code the whole column will turn off ...
If you want to turn off individual sideboxes, look at how the featured.php sidebox module is written where you see:
currently, nothing "controls" or changes that sidebox but the code is there so that you "could" change when this shows such as only show the sidebox when on the main page:Code:// test if box should display $show_featured= true; if ($show_featured == true) {
Notice on this sidebox how the IF statement surrounds the whole code ...Code:// test if box should display $show_featured= true; if (!$this_is_home_page) { $show_featured= false; } if ($show_featured == true) {
Any sidebox where this type of IF does not exist, you can set it up yourself to have similar logic ...
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: v1.5.5]
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!
Bookmarks