Hi
I would like to know how to display a certain sidebox for product info pages only. Just like manufacturers is only displayed for product info pages.
It will be content within a blank sidebox.
Is it a CSS entry I have to add?
Thanks for the help
S
Hi
I would like to know how to display a certain sidebox for product info pages only. Just like manufacturers is only displayed for product info pages.
It will be content within a blank sidebox.
Is it a CSS entry I have to add?
Thanks for the help
S
Quick answer - no - you need a conditional php statement.Is it a CSS entry I have to add?
Please do not PM for support issues: a private solution doesn't benefit the community.
Be careful with unsolicited advice via email or PM - Make sure the person you are talking to is a reliable source.
Some variation of this:
https://www.zen-cart.com/tutorials/i...hp?article=270
or you could use page-specific stylesheets that didn't display that sidebox.
In your sidebox file
includes/templates/YOUR-TEMPLATE-NAME/sideboxes/tpl_YOUR_SIDEBOX.php
around where you update $content[] to add the content, say something like
if ($current_page_base != "product_info") {
... content code
}
That Software Guy. My Store: Zen Cart Support
Available for hire - See my ad in Services
Plugin Moderator, Documentation Curator, Chief Cook and Bottle-Washer.
Do you benefit from Zen Cart? Then please support the project.
You might be able to do it with CSS... but it is a bit "clunky"
Create a blank sidebox, but give it a specific name, following the conventions for naming a sidebox.
Then, in your MAIN stylesheet:
Add the following at the bottom:
#YOURSIDEBOXNAME.leftBoxContainer {display:none;}
(This will be SITE-WIDE).
Then, create a PRODUCT-SPECIFIC stylesheet, to override the otherwise site-wide declaration:
p_12345.css (where 12345 is the product ID)
Into THAT stylesheet, put:
#YOURSIDEBOXNAME.leftBoxContainer {display:block;}
naturally, if it is in the RIGHT column...
.leftBoxContainer becomes .rightBoxContainer
20 years a Zencart User
I just re-read your original post... You want the sidebox for ALL product info pages... not just one.
My solution will be specific to a single PRODUCT... not the product info system in general.
20 years a Zencart User
If you are starting from the Blank Sidebox mod, there is already code to handle conditional display. You only need to set the condition.
In /includes/modules/sideboxes/YOUR-TEMPLATE-NAME/YOUR_SIDEBOX.php, find this (adjust to your sidebox name):ChangePHP Code:// test if box should display
$show_blank_sidebox = true;
if ($show_blank_sidebox == true) {
$show_blank_sidebox = true;
to
$show_blank_sidebox = true;
if ($current_page_base != "product_info") $show_blank_sidebox = false;PHP Code:// test if box should display
$show_blank_sidebox = true;
if ($current_page_base != "product_info") $show_blank_sidebox = false;
if ($show_blank_sidebox == true) {
Amazing... you can always trust Glenn to provide the best and most practical answers!
20 years a Zencart User