Zen Follower
- Join Date:
- Jun 2010
- Posts:
- 204
- Plugin Contributions:
- 0
Post #1 by hockey2112
Hello,
I have a client who wants to hide their product category sidebar when you are on an EZ Page (I know, I know...). lIs this possible? If so, how?
Thanks!
Started by hockey2112 on 20 Sep 2011, 9:01 PM · Views: 7,494
Zen Follower
Hello,
I have a client who wants to hide their product category sidebar when you are on an EZ Page (I know, I know...). lIs this possible? If so, how?
Thanks!
Black Belt
The whole sidebar, or just the categories sidebox?
It can be done with CSS (quick & dirty) or by a small edit in a PHP file (which file depends on exactly what you want to do).
New Zenner
I am also working on a client's site, and need to hide specific categories on specific EZ Pages. What is the best way to do it? I saw some discussion about creating a CSS file; would appreciate any help on the best way to accomplish it. Thank you!
Irina
Zen Follower
gjh42:
The whole sidebar, or just the categories sidebox?
It can be done with CSS (quick & dirty) or by a small edit in a PHP file (which file depends on exactly what you want to do).
Just the sidebox. The EZ Pages sidebox (and a few others) will still be displayed.
Black Belt
Quick & dirty: Add to your stylesheet
#pageBody #categories {display: none;}
Proper way: Edit /includes/modules/sideboxes/categories.php; at the top of the file, add
if ($current_page_base != 'page') {
before
$main_category_tree = new category_tree;
and after
require($template->get_template_dir($column_box_default, DIR_WS_TEMPLATE, $current_page_base,'common') . '/' . $column_box_default);
add
}
Save the edited file to /includes/modules/sideboxes/your_template/categories.php
New Zenner
Quick & dirty: Add to your stylesheet
#pageBody #categories {display: none;}
This works great for hiding ALL categories on an EZ page.
What if I needed to hide several, but not all, categories on a page? Not sure of the best way of doing it (client's choice, BTW).
Would greatly appreciate any ideas on how to go about it. I'm quite stuck here :smile:
Black Belt
You mean just some of the category links in your categories sidebox? The only way beside new custom coding would be to install Categories Dressing, configure it so that the desired categories were in "groups" (see the readme), and add a rule to your stylesheet like
#pageBody #catGroup23, #pageBody #catGroup47, #pageBody #catGroup69 {display: none;}
New Zenner
Yes, that's what I am talking about. Since I can't write my own custom coding, I'll try your second suggestion. I'll be back :smile: Thank you so much for great advice--always!
Irina
Zen Follower
gjh42:
Quick & dirty: Add to your stylesheet
#pageBody #categories {display: none;}
Proper way: Edit /includes/modules/sideboxes/categories.php; at the top of the file, add
if ($current_page_base != 'page') {
before
$main_category_tree = new category_tree;and after
require($template->get_template_dir($column_box_default, DIR_WS_TEMPLATE, $current_page_base,'common') . '/' . $column_box_default);
add}
Save the edited file to /includes/modules/sideboxes/your_template/categories.php
This code works, but it does the opposite of what I want to do... it hides the product categories sidebox when you are on a product-related page; I want the products sidebox to be hidden when you are on any of the EZ Pages. :)
Possible?
Black Belt
Exactly how did you copy the code into your file? As written here, it will only show the sidebox if $current_page_base is NOT 'page'.
Zen Follower
gjh42:
Exactly how did you copy the code into your file? As written here, it will only show the sidebox if $current_page_base is NOT 'page'.
My code now looks like this:
if ($current_page_base == 'page') {
$main_category_tree = new category_tree;
and this...
$title_link = false;
require($template->get_template_dir($column_box_default, DIR_WS_TEMPLATE, $current_page_base,'common') . '/' . $column_box_default);
}
Black Belt
if ($current_page_base == 'page') {
$main_category_tree = new category_tree;
```is wrong. It needs to be != (not equal) instead of == (equal).```php
if ($current_page_base != 'page') {
$main_category_tree = new category_tree;
Zen Follower
gjh42:
if ($current_page_base == 'page') {
$main_category_tree = new category_tree;
is wrong. It needs to be != (not equal) instead of == (equal).php
if ($current_page_base != 'page') {
$main_category_tree = new category_tree;
That did the trick! Thanks!
New Zenner
gjh42:
You mean just some of the category links in your categories sidebox? The only way beside new custom coding would be to install Categories Dressing, configure it so that the desired categories were in "groups" (see the readme), and add a rule to your stylesheet like
#pageBody #catGroup23, #pageBody #catGroup47, #pageBody #catGroup69 {display: none;}
GJH - You're advise has been great in helping me set up my zen cart. I'm working with your category dressings mod to style my site category navigation and I'm also using the multsite model. I've got several categories for my other sites that I don't want to show up in the navigation on my primary site. Here is a link:
http://nwfapco.com/index.php?main_page=index&cPath=1&zenid=0hl8kfftts9ipmn0p3mai27oo0
Basically you can see the categories on the right side navigation have many more than are being displayed on actual site. How could I basically hide the "Real Estate Signs" Category and the sub categories? I'd like to hide all the categories for all my other sites.
Thanks!
NWFAP
Totally Zenned
I want to display a sidebox containing a banner on EZ Pages only. NOT everywhere else on the site. So what is the method for that?
I have this but this displays the banner everywhere else except EZ Pages
<?php if ($current_page_base != 'page') { $show_new_sidebox = true; if ($show_new_sidebox == true){ require($template->get_template_dir('tpl_venbanner_sidebox.php',DIR_WS_TEMPLATE, $current_page_base,'sideboxes'). '/tpl_venbanner_sidebox.php'); $title = BOX_HEADING_NEW_SIDEBOX; $left_corner = false; $right_corner = false; $right_arrow = false; require($template->get_template_dir($column_box_default, DIR_WS_TEMPLATE, $current_page_base,'common') . '/' . $column_box_default); }}?>
I've obviously tried it like this
if ($current_page_base = 'page')
But that just displays it everywhere.
I could of course use CSS but I want to avoid that if possible.
Nick Smith - Venture Design and Print
https://venturedesignandprint.co.uk
Administrator
Try, instead
if ($current_page_base =[B]=[/B] 'page')
or, even better
if ($current_page_base =[B]= FILENAME_EZPAGES[/B])
With a single =, that statement was an assignment that always evaluated to 'true'.
Tell staff why this post should be reviewed.