Alright, I went back and reset all of the pages and then started fresh from the instructions. The images are still not linking and there are error text links showing up below them. What am I doing wrong?
Printable View
Alright, I went back and reset all of the pages and then started fresh from the instructions. The images are still not linking and there are error text links showing up below them. What am I doing wrong?
It looks like there are two problems. First, you are defining headings when you want category links. Do not use any of those defines - comment them all out.
Second, you are somehow getting the classname generated incorrectly. You should be getting output similar to thisNote the space; this is two classnames, cat-not-selected and catBg25.Code:<li class="cat-top"><a class="cat-not-selected catBg25" href="
You are getting thisThis is one classname, cat-not-selectedcatBg69, and .catBg69 in the stylesheet will have nothing to do with this name.Code:<li class="cat-top"><a class="cat-not-selectedcatBg69" href="http://shoptekne.com/zencart/index.php?main_page=index&cPath=69"><img src="includes/templates/tekne_default/images/pixel_trans.gif" alt="" width="100%" height="100%" title="Necklaces" /></a></li>
The space is created in categories_dressing_functions.php; did you do any editing of that file at all?
' catBg' has a space before cat, which is necessary for the function to work.PHP Code:
function cat_name_display($cat_name_display, $current_path) {
//...
//display background image if exists for category name in current language - with title tag
} elseif (file_exists(DIR_WS_TEMPLATE . 'buttons/' . $_SESSION['language'] . '/catbg' . $current_path . CAT_NAME_IMG_EXT)) {
$cat_name_display = zen_image(DIR_WS_TEMPLATE_IMAGES . 'pixel_trans.gif', '', '100%', '100%', 'title="' . $cat_name_display . '"');
$cat_img_bg = ' catBg' . $current_path;
What does that line in your copy of categories_dressing_functions.php look like?
Weirdly enough when I deleted and replaced the functions page it started working fine. I guess it was a dreamweaver issue. Thanks for all of your help!
Can someone tell me how to remove this thing from my zen cart? I wanted banner images for my sideboxes and I ended up with a mess of stuff I don't understand or have time to figure out. I do not need images in my category box, just images to add in place of the text for my sideboxes. If someone could explain how to implement this or tell me how to remove without crashing my site, I would greatly appreciate it. :lamo:
http://www.allclipart.info/store
Thank You...amandavz
Categories Dressing will let you have images in place of text in your categories sidebox, but it does not affect other sideboxes.
The readme.html has complete instructions for substituting images, as well as bold notes for turning off the features you don't need.
If you want to uninstall it, just delete the files in the mod (the readme has a complete file list).
Hi Glen,
Thanks for the quick response. Maybe I am a total moron, but I would have to be college degreed to understand your instructions. I was looking for zen cart for dummies instructions. I did try to delete the files in the mod once already and I lost all side boxes and content for my site, I was left with only a background, header and "HOME / LOGIN" buttons at the top.
None of the mod files overwrites any existing file, so deleting them would have no effect on the rest of the site. First try deleting /includes/templates/your_template/sideboxes/tpl_categories.php. Without that one, the rest just sit there and do nothing.
There are many options in this mod, so the readme needs to have a lot of text. The basic information for replacing category names with images is just this:
To display images in place of selected category names:
Make your images with names like catimg#.gif (or catbg#.gif and catbg#hover.gif), and save in /includes/templates/your_template/buttons/english/. ...
Replace the # with the category cPath.
@Glenn
regarding my problem described in this thread I am switching to support thread :smartalec:
I have followed installation instructions for Categories Dressing and installed it successfully. Problem for me is where to start and what is the first step, so I could achieve my subcategories listing looks like this:
http://img138.imageshack.us/img138/6494/28265514.jpg
instead of this
http://img138.imageshack.us/img138/5663/41595109.jpg
also, in last post you have mentioned that I must have good knowledge of CSS, no problem I think I will be able to handle it :bigups:
find a hard time playing with the parameter. can you suggest any combination?
for example, i want all the tree when any cate or sub cate or sub sub cate is select
adi2009 -
If all your client wants is to have the current category's subcategories listed as you show, you can do it with one rule change in your regular stylesheet - something like this.But I had the impression that they wanted a bunch more customization. If you want the "Parts" sidebox on the right at the last subcat level, you would use the #chcategories sidebox for the main (left) menu and the #categories sidebox on the right with code to let it show only at the right level.Code:.categoryListBoxContents {
width: 100% !important;
float: none;
border: 2px solid #224466;
background: #aabbcc;
text-align: left;
}
weber -
By "all the tree" do you mean the active top cat and all its subs? And what do you want to show when no category is active?
first, code you suggested worked like charm:bigups::bigups:
regarding my client: he gaved me to links of websites which have subcategories listing that are acceptable for him,
1. http://kejparts.katalogazja.pl
This is is the first one and most acceptable for him (because there will be ton of products and categories so it is important that listings are simple and easy for use).
2. http://www.milneroffroad.com
This one is also acceptable for him but he primarly would like to have listing system like on link I have mentioned on number one position. With your help, I have acomplished to have listing similar to this link on second position.
As I have mention in text above, my goal is primarly to create subcategories listing similar to link on number one position, so now I will try to customize it following your tips/suggestions:
for this part, no problem, I used #chcategories sidebox as the main menuQuote:
use the #chcategories sidebox for the main (left) menu
do I have to set #categories sidebox on the riht column or main midlle column cause I have disabled "Column Right Status - Global" under Admin>Configuration>Layout Settings ? I am not sure what exactly have to and also how to change code to let it show only at right level?Quote:
#categories sidebox on the right with code to let it show only at the right level
I'm glad it's not an impossible thing. but unfortunately, my level of expertise isn't good enough to figure out what u said and bring it to life. a brief step-by-step and file-by-file description would be a great help. I have all the corresponding gif images for the categories that I want to be highlighted when a visitor is viewing the corresponding content.
also, please help me remove 'all products' underneath the categories
THANKSSS!
@Glenn
just to inform you: I presented subcategorie listing similar to milneroffroad.com and he aprooved it, so thanks man! right now I am working little on design and its going OK
Cheers! :smile:
karkar - The All Products link can be turned off in Configuration > Layout Settings.
I can go into more detail after Christmas for the special categories.
adi2009 - Glad the client is happy so far! The #categories sidebox would go in the right column, and you would need to do the custom coding to make the right column and sidebox only show in the correct conditions. This is a common bit of code which is described elsewhere in the forum.
You would probably want to make the left sidebox show only top categories, and the right sidebox show the subcategories of the current top or selected sub.This could be done with a stylesheet rule for the left, or a bit of code changed if processing time matters. The right will be in the define settings. A more sophisticated control might require some new code for that too.
I'll get into that after Christmas.
[QUOTE=gjh42;821401]karkar - The All Products link can be turned off in Configuration > Layout Settings.
I can go into more detail after Christmas for the special categories.
Great, we'll get to that after Christmas. as for the 'all products' i removed it, but the spot remains, i.e. a divider and borders surrounding the absence of all products... :(
Try turning off Featured, New and Specials as well. The links will only show if there is content, but the section will show if any of them are enabled.
Not as such, but you can add your own form code to a Blank Sidebox or Editable Sidebox from Free Addons.
I have Version 1.3.8a
I bought a TemplateMonster called my_template. Everything is working fine. Now
I would like to use Category Dressing Module so I can use Uncollapsed Categories Tree.
I am missing some of the folder. The installation is asking for
/includes/languages/english/extra_definitions/your_template/categories_dressing_defines.php
and
/includes/modules/sideboxes/your_template/ch_categories.php
I dont' have your_template. I mean I bought a TemplateMonster Template (call mytemplate)
I have /includes/modules/sideboxes/classic but it is empty
my template is located /includes/modules/mytemplate
and /includes/templates/mytemplate/
What do I do?
Thank you
:ohmy:
There are about five different category display settings in categories_dressing_defines.php, so you can just try them one by one and see if you like the result. They are described briefly in the readme and the file comments, so you should have an idea of what to expect. Try option 2 for top cats when there is no selection.
It is always possible to create a new type of display logic in categories_dressing_functions.php if you know PHP.
I asked my question earlier but I didn't write it clearly.
Could you guys please help?
I am a Sr Linux Admin. (so I really understands the installation steps )
I have Version 1.3.8a Zecart and TemplateMonster installed.
(TM001). Everything is working fine.
However, I would like to use Category Dressing Module so I can use Uncollapsed Categories Tree and Category Dressing Feature.
The Category Dressing installation is asking for
"
/includes/languages/english/extra_definitions/your_template/categories_dressing_defines.php
.
/includes/modules/sideboxes/your_template/ch_categories.php"
My TM001 is located in a different directory/folder path.
"/includes/modules/TM001"
and " /includes/templates/TM001/"
Is this case how will I able to install Category Dressing ?
"/includes/modules/sideboxes/classic" is empty
What do I do?
Thank you
:unsure:
one more question, with the ch_categories sidebox, how to css markup the active top cate?
digulu - You would use your TM template foldername in place of "your_template".
/includes/languages/english/extra_definitions/TM_001/categories_dressing_defines.php
/includes/modules/sideboxes/TM_001/ch_categories.php
weber - If you have navigated to the product info page through categories/subcategories, Zen Cart by default will have a cPath in the URL. Some SEO mods may eliminate that and may not show how you got there, meaning that if the product is linked to two categories it is not possible to know the active category. A link to see your site will make it easier to advise on this problem.
Code:/*change bullet/styling when a top category w/o bg image is open to subs:*/
#categories li.cat-top a.cat-parent-text {
list-style: square inside url(../images/bullet2.gif);/*change to list-style: none; to remove bullet*/
font-weight: bold;/*or any other styling desired*/
}
/*change bullet/styling when a top category w/o bg image is open to products:*/
#categories li.cat-top a.cat-selected-text {
list-style: square inside url(../images/bullet3.gif);/*change to list-style: none; to remove bullet*/
font-weight: bold;/*or any other styling desired*/
}
Hi gjh42
Thank you for your reply.!
>digulu - You would use your TM template foldername in place of >"your_template".
>/includes/languages/english/extra_definitions/TM_001/categories_dressing_defines.php
>/includes/modules/sideboxes/TM_001/ch_categories.php
I will have to create a folder for
"/includes/languages/english/extra_definitions/TM_001"
and
"/includes/modules/sideboxes/TM_001"
Since I don't have them.. Again, TM004 is installed in different directory or folder.
My TM001 is located in a different directory/folder path.
"/includes/modules/TM001"
and " /includes/templates/TM001/"
Is this still make senses?
Thank you.
What's this with TM004 and TM001? Whichever foldername is used for your template is the one to use for the mod files.
You may have an /includes/modules/TM001/ folder and an /includes/modules/sideboxes/TM001/ folder - they are meant to hold different files. You need to use the same kind of structure as the mod files are packaged with.
Hi gjh42:
Thank you for your help.
I have installed Category Dressing.
However, I only see on layout box controller is being added "sideboxes/theme227/ch_categories.php" when I go "Tool -> Layout Box Controller"
Is this mean I have successfully installed Category Dressing ?
My site is http://digulu.x10hosting.com/store/
I have read few time Category Dressing Readme about the application parts. I have still very confused. Could you please help me.. a little bit?
I mean how do I make my every main categoris example: "Audio Cables - Digital Coaxial" to have a Major Heading Bold look?
Currently I have three Categories but someone it only shows two categories. (Subcategories showed fine). Why is that?
Sorry I am not good at php programming..please give me some guideline.
thank you again!
The "Cat3sample" image is replacing the Audio Cables - RCA text because that is category id #3. Delete the image /includes/templates/your_template/buttons/english/catimg3.gif and the text will reappear.
I have to leave now, so I will answer more when I get back tomorrow.
Greeting gjh42:
I have played around categories_dressing_defines.php sample. I understand better now. I think I not still not get it.
Could you please help me?
Questions:
1) All define examples
define ('CAT_BOX_HEADING_2','0|1|||Audio Cables - Digital Coaxial|2');
worked fine with my Main Category but what does not work SubCategory. ( I didn't see any changes). Why is that?
2) How will I able to still have Main Category listing url when I click my Category1 ? I like to be able to do like this website
http://www.smokin-paint.com/
This site used Category Dressing to change the Main and Sub Categories and still remain the Categorys' links? How did they do that?
3) I would like to change the colour of the "fill" and fonts colour. Could you please give me hint where I should starts?
THank you very much again.
1. with the ch_categories sidebox, how to css markup the active top cate? besides, it's is always a good idea to markup active cates. as we can assign a different styles. for example, the top cate is uncollapsed/active, so we can add a background to it's sub-cates
2. I got you, but there is a possibility, for example, featured, special... whatever...and that will be a bug because the tree collapsed when you go into product info...just get the $_GET['cPath'] is not enough. can you tell me which line you decide the cpath, so i can add the portion without dig into the codes. besides, it's a great mode.
digulu -
Heading defines are not for changing the category name link. You will just want to edit in your stylesheet_categories_dressing.css the
#categories ul a {/*top categories*/
and
#categories ul ul a {/*subcategories*/
rules, and possibly the
#categories ul {/*top category lists*/
and
#categories ul ul {/*subcategory lists*/
rules, for backgrounds and colors.
smokin-paint.com used background-images as shown in red. Yours would be similar to this.
Code:#chcategories ul{list-style:none;background:none;border:none;margin:0 0 0.4em 0;padding:0}
#chcategories ul a{display:list-item;color:#000;
list-style:disc inside url(/includes/templates/classic/images/bullet1.gif);
background-image:url(/includes/templates/classic/images/catback8.jpg);background-repeat:no-repeat;border:none;
margin:2px 0px;padding:1px 0px 2px 0px}
#chcategories ul ul{
list-style:none;display:list-item;background-image:url(/includes/templates/classic/images/catback1.jpg);
background-repeat:repeat-y;border:none;margin:0em;padding:0 0 0 1.3em}
#chcategories ul ul a{
display:list-item;color:#000;list-style:circle inside url(/includes/templates/classic/images/bullet1.gif);
background-image:url(/includes/templates/classic/images/catback6.jpg);
background-repeat:no-repeat;border:none;margin:2px 0px;padding:1px 0px 2px 0px}
#chcategories li a.cat-parent-text{
list-style:square inside url(/includes/templates/classic/images/bullet2.gif)}
#chcategories li a.cat-selected-text{list-style:square inside url(/includes/templates/classic/images/bullet3.gif)}
#chcategories li a.cat-parent, #chcategories li a.cat-selected, #chcategories li a.cat-not-selected{
list-style:none;display:block}
#chcategories li.cat-top a:hover{
color:#000;background-image:url(/includes/templates/classic/images/catbghover.gif);background-repeat:no-repeat}
-----------#categories li li.cat-subs a:hover, #categories li li.cat-products a:hover{color:#000;background-image:url(/includes/templates/classic/images/catbghover1.gif);background-repeat:no-repeat}
#chcategories li a.catBg25{
background-image:url(/includes/templates/classic/buttons/english/catbg25.gif);height:30px}
#chcategories li a.catBg25:hover{
background-image:url(/includes/templates/classic/buttons/english/catbg25hover.gif)}
#chcategories li.cat-holiday a{
border-top:3px dotted #123;background-color:#abf;color:#123;padding:1em 0em}
ul#catGroup48{border:1px solid #bd6699;background:#bef;position:relative;left: -1.3em;top:0.2em}
.catCount{color:#000}
.catBoxDivider1{display:none}
#catBoxDivider{display:none}
weber -
1: For active top cats, one of these selectors will apply:
#chcategories li.cat-top a.cat-parent-text, #chcategories li.cat-top a.cat-selected-text {}
2: In my test installation (mostly stock Classic template), the new/featured/etc. products when clicked from any location I tried included a cPath in the URL, and displayed the active styling in my test Categories Dressing installation. If it doesn't work for you, there is something outside Categories Dressing that is blocking the path info.
Hello there,
Is this mod compatible with HideCategories?
Thanks...
Have you downloaded the hideCategories mod files? If it has a copy of /includes/templates/your_template/sideboxes/tpl_categories.php, then the two mods cannot be used together without merging code. If that file is not present, there should be no conflict.
Note: if using the "uncollapsed categories tree" version of Cat Dressing, you will also need to account for /includes/modules/sideboxes/your_template/categories.php.
hm...not sure this is the right place to post this?
I have added the categorie dressing module to my page - here
I want to be able to add three pages - 'Design' 'Print' and 'Web' so that when you click the headings they go to those pages. I have been advised to use the E-Z pages for this but how would I add an E-Z page and the have that page linked from within the category (headers). Ive not used the E-Z pages before and I'm a bit baffled and unsure as to how I would do this! :blush:
Is there a step by step guide?
Thanks
The process would be the same as I advised you before (post 1083). Add headings to whatever product(s) you want just below your new buttons. If you want all the buttons in a group, try this:
Change the 9 to your category id.PHP Code:
define ('CAT_BOX_HEADING_9','0|0|||<a href="index.php?main_page=page&id=5">Design</a>|3|<a href="index.php?main_page=page&id=6">Print</a>|3|<a href="index.php?main_page=page&id=75">Web</a>|3');
Change the 5/6/7 to your ez-page ids.
Make or edit a stylesheet rule for
.catBoxHeading3 {}
with whatever styling you want for those links. This could include a background image of a button.
If you want graphical buttons with fancy text, that is possible. It would require some extra code in the define.
Should have looked at your current page first. You appear to already have the heading links you need; you just need to point them to your ez-pages. Changing the "index.php" to "index.php?main_page=page&id=5" will do it. Like this:Change the 5 to whatever the ez-page id is.PHP Code:
define ('CAT_BOX_HEADING_107','1|0|||<a href="index.php?main_page=page&id=5">Design</a>|1');
You don't need to change your stylesheet.
Hi,
You may have answered this before. Or maybe you can PM or direct the answer to me. I'm not too familiar with coding.
http://giftpackaging.com.au/
how can I apply an image to "specials..."
Michael
I'm not sure what you're asking for. You already have a nicely done set of background images applied to all the top categories including "Specials" category 66.
Are you referring to the new/all products links?
Categories Dressing does not have a specific image substitution feature for the links at the bottom of the categories box.
The constant CATEGORIES_BOX_HEADING_SPECIALS is only used in the categories sidebox, so you can safely add the <img> code to its definition in /includes/languages/your_template/english.php, Line #99 :Code:define('CATEGORIES_BOX_HEADING_SPECIALS','Specials ...');
If the zen_image() function doesn't give the right results here, tryCode:define('CATEGORIES_BOX_HEADING_SPECIALS',zen_image(DIR_WS_TEMPLATE . 'buttons/' . $_SESSION['language'] . '/catimgspecials.gif', 'Specials') );
Save the image asCode:define('CATEGORIES_BOX_HEADING_SPECIALS','<img src="' . DIR_WS_TEMPLATE . 'buttons/' . $_SESSION['language'] . '/catimgspecials.gif" alt="Specials" />');
/includes/templates/your_template/buttons/english/catimgspecials.gif
A more robust way of doing image substitution would be to change the tpl_categories.php code to do an image file lookup/substitution with the same function the categories use.
As an example, for the specials link, change thisto thisPHP Code:
if (SHOW_CATEGORIES_BOX_SPECIALS == 'true') {
$cat_box_link_head = cat_box_heading('SPECIALS');
$content .= $cat_box_link_head[1];
$show_this = $db->Execute("select s.products_id from " . TABLE_SPECIALS . " s where s.status= 1 limit 1");
if ($show_this->RecordCount() > 0) {
$content .= '<li><a class="category-links" href="' . zen_href_link(FILENAME_SPECIALS) . '">' . CATEGORIES_BOX_HEADING_SPECIALS . '</a>' . '</li>' . "\n";
}
}
Not tested yet, but this should use the image atPHP Code:
if (SHOW_CATEGORIES_BOX_SPECIALS == 'true') {
$cat_box_link_head = cat_box_heading('SPECIALS');
$content .= $cat_box_link_head[1];
$show_this = $db->Execute("select s.products_id from " . TABLE_SPECIALS . " s where s.status= 1 limit 1");
if ($show_this->RecordCount() > 0) {
//test 20100124
$link_name_display = cat_name_display(CATEGORIES_BOX_HEADING_SPECIALS, 'specials')
$content .= '<li><a class="category-links" href="' . zen_href_link(FILENAME_SPECIALS) . '">' . $link_name_display[1] . '</a>' . '</li>' . "\n";
// /test 20100124
}
}
/includes/templates/your_template/buttons/english/catimgspecials.gif
including (with the new v2.8 code) automatically adjusting the image type to whatever is globally set in categories_dressing_defines.php, or using the standard text if the image is not found.
Applying this change to the rest of the links will be straightforward.
A refinement would be to adjust the classname to reflect whether or not an image has been substituted, allowing precise list-item marker control (removing the bullet if an image is used).This will give a classname of .category-links for images and .category-links-text for text.PHP Code:
//test 20100124
$link_name_display = cat_name_display(CATEGORIES_BOX_HEADING_SPECIALS, 'specials')
$content .= '<li><a class="category-links' . $link_name_display[0] . '" href="' . zen_href_link(FILENAME_SPECIALS) . '">' . $link_name_display[1] . '</a>' . '</li>' . "\n";
// /test 20100124
Hi Glen,
I removed the category 66 Specials, as I do want to apply the image to the standard specials link under the categories.
I was able to apply your first code to change definition in /includes/languages/your_template/english.php, Line #99
It worked perfectly, however the standard 'bullet' was in the front of the Image, which doesn't look that great and skewed the alignment of the other images above.
I then changed it back, and tried your 2nd code suggestions, however it didn't work. It actually removed all the content and side categories.
For now, just use the first "define" method, and uncomment this rule in stylesheet_categories_dressing.css and change
disc inside url(../images/bullet4.gif)
to
noneI will test the code and post a working version later.Code:/*different bullet for links if desired*/
#categories li a.category-links {
list-style: none;
}
Hi I am not sure if this is anything to do with BetterCategories but on http://www.noahsark.co.uk the category Winter Sale is in red and no other category is...... Now I know how to change the colour of this and I am up on where and how the style sheet it changes for the category colours.
I don't however know why specifically that category is in red? It is category ID 1. My guess is somehow I can specify a particular category as the featured one or something?
Please help, this is very annoying. All I want to do is highlight some other sale categories.
Thanks in advance.
You are using BetterCategories, not Categories Dressing, so you need to ask in that mod's support thread.
Thanks Glenn - that has worked perfectly.
Does anyone have a website up at the moment with this mod? I would be good to see an example of what it can look like.
limelites.co.uk is one with an extensive installation. There are also examples that are currently operational linked in posts 1141, 1138, 1130, and more if you look further back.
So you can categorize the categories... fantastic! Thanks for taking the time to show some examples... looks like it's what I'm looking for.
There are also demo screenshots in posts 500-510, showing more features the mod is capable of.
connected to my last post regarding cetegories in my left sidebox I am switching to this thread:wink:
@GlennCode:"This thread was very helpeful to me because I need same thing on my website and I achieved it thanks to Glenns code bellow
Code:
// subcat limit 2007-12-20
if (substr_count($box_categories_array[$i]['path'],'_') = 0 or zen_get_product_types_to_category($box_categories_array[$i]['path']) == 3 or ($box_categories_array[$i]['top'] != 'true' and SHOW_CATEGORIES_SUBCATEGORIES_ALWAYS != 1)) {
// skip if this is for the document box (==3)
} else {
but in my case I dont need subcategories to show any further subcategories. To explain what I want to achieve here's the example:
-----------------------------------------------
THIS IS HOW IT LOOKS LIKE NOW:
-----------------------------------------------
MAZDA (1st subcategorie level)
- mx (2nd subcategorie level)
-- 2005 year (3rd subcategorie level)
-- 2006 year
-- 2007 year
- cx
- rx
MERCEDES
- c
- e
- s
MITSUBISHI
- lancer
- pajero
- l200
-----------------------------------------------
THIS IS HOW I NEED IT:
-----------------------------------------------
MAZDA (1st subcategorie level)
MERCEDES
MITSUBISHI
Any help is wellcome, thanks! "
Yes, I am using Categories Dressing add on. Now where do I start, using Cat.Dr., so I could acomplish to have only 1st level subcategorie visible and all other categ./subcat. hided.. I looked through folders of my zencart wesite (in includes/classes) and found "ch_categories_tree_generator" Is this a file I should edit?
No, that file generates the complete list, while the template file (and its functions) limits the display according to the settings.
What is your current setting for
define('CAT_BOX_ACTIVE_LEVEL', '#|#|#')
If you want different levels of (sub)categories to show in the different sideboxes, as I believe is your intention, it may require some special coding.
You have the standard categories sidebox at the top left, and the chcategories sidebox below it. Do you want both of them displayed?
thank you for promt reply Glenn, really appreciate it
no, its OK, for start I will use only one sidebox - ch_categories.php
I have disabled first sidebox at the top left (classic categories.php) few minutes ago, so I will use only one: ch_categories.php What is first step I should do with Categories Dressing so I could see only 1st level subcategorie visible and all other categ./subcat. hided?Quote:
You have the standard categories sidebox at the top left, and the chcategories sidebox below it. Do you want both of them displayed?
sorry I forgot to answer this one:blush:
code from file "categories_dressing_functions.php"
Code:function cat_active_level_manage($path) {
$skip_cat = 0;
if (defined('CAT_BOX_ACTIVE_LEVEL')) {
$test_level = 0;
$cat_box_active_level = explode('|',constant('CAT_BOX_ACTIVE_LEVEL'));
$cPath_top = (int)$_GET['cPath'];
$path_top = (int)$path;
$cat_depth = substr_count($path,'_');
//tests for various kinds of skipping - more can be added
switch ($cat_box_active_level[0]){
case 0:
$test_level = 1;
break;
case 1://active tree only
if($cPath_top != $path_top) $skip_cat = 1;
break;
case 2://active only (all tops when no cat selected)
if($cPath_top != $path_top and $cPath_top != 0) $skip_cat = 1;
break;
case 3://full active tree, others per level
if($cPath_top != $path_top) $test_level = 1;
break;
case 4://like 3, active branches only
if($cPath_top == $path_top){
if ($cat_depth >= 2){//only test sub-subcats+
$path_ids = explode('_',$path);
$path_parent = $path_ids[count($path_ids)-2];
if (!in_array($path_parent,explode('_',$_GET['cPath']))) $skip_cat = 1;//show only subcats w parent in $cPath
}
} else {//if not active test for level
$test_level = 1;
}
break;
case 5:// show active, no top, per levels
if ($cat_depth == 0 or $cPath_top != $path_top) {
$skip_cat = 1;
}else{
$test_level = 1;
}
break;
}//switch
if ($test_level){
switch ('true'){
case ($cat_box_active_level[1] > $cat_depth):
$skip_cat = 1;
break;
case ($cat_box_active_level[2] < $cat_depth):
$skip_cat = 1;
break;
}//switch
}//if
}//defined
return $skip_cat;
}
OK, that makes it easy.
You didn't mention your current setting for
define('CAT_BOX_ACTIVE_LEVEL', '#|#|#')
It should probably be
define('CAT_BOX_ACTIVE_LEVEL', '0|1|1')
The function code is not the setting, and yours shows that it is the standard version of the function.
OK, I changed code in categories_dressing_functions.php saved/upload it and it now it looks like this:
Quote:
function cat_active_level_manage($path) {
$skip_cat = 0;
if (defined('CAT_BOX_ACTIVE_LEVEL','0|1|1')) {
$test_level = 0;
$cat_box_active_level = explode('|',constant('CAT_BOX_ACTIVE_LEVEL'));
$cPath_top = (int)$_GET['cPath'];
$path_top = (int)$path;
$cat_depth = substr_count($path,'_');
//tests for various kinds of skipping - more can be added
switch ($cat_box_active_level[0]){
case 0:
$test_level = 1;
break;
case 1://active tree only
if($cPath_top != $path_top) $skip_cat = 1;
break;
case 2://active only (all tops when no cat selected)
if($cPath_top != $path_top and $cPath_top != 0) $skip_cat = 1;
break;
case 3://full active tree, others per level
if($cPath_top != $path_top) $test_level = 1;
break;
case 4://like 3, active branches only
if($cPath_top == $path_top){
if ($cat_depth >= 2){//only test sub-subcats+
$path_ids = explode('_',$path);
$path_parent = $path_ids[count($path_ids)-2];
if (!in_array($path_parent,explode('_',$_GET['cPath']))) $skip_cat = 1;//show only subcats w parent in $cPath
}
} else {//if not active test for level
$test_level = 1;
}
break;
case 5:// show active, no top, per levels
if ($cat_depth == 0 or $cPath_top != $path_top) {
$skip_cat = 1;
}else{
$test_level = 1;
}
break;
}//switch
if ($test_level){
switch ('true'){
case ($cat_box_active_level[1] > $cat_depth):
$skip_cat = 1;
break;
case ($cat_box_active_level[2] < $cat_depth):
$skip_cat = 1;
break;
}//switch
}//if
}//defined
return $skip_cat;
}
but no changes on left sidebox on website (you can check it out when you click on "Selling parts" in top menu bar)
No! You don't want to change the code in categories_dressing_functions.php at all.
Set the define in /includes/languages/english/extra_definitions/your_template/categories_dressing_defines.php as shown.
Yes, I also just checked some of the older post in meantime, on this thread (link) and I see I made mistake changing wrong file, I will correct/test it right away:wink:
first, sorry for little delay with post, I was exhausted last night after working on my site all day:shocking::smile: I didnt fully read help files so this morning I read it all, set up my categories_dressing_defines.php file and also css and its working/looks great! Thanks Glenn you rock:clap:
However, I have one more thing to workout: I need one more sidebox on rightcolumn which will have display-limiting set to '0|5|4' (becuse my clients wants this option). I am not sure how to acomplish this, is there some Addon which could be helpful, or should I somehow make copy of original categories sidebox and use that copy to put it in right column?
That second categories box is going to be the interesting one. Using different settings for each box will require some cloned and renamed code, and a test to decide which to use in a given situation. It can be done, but will take a bit of work. I'll look at it to get a sense of the best route.
OK Glenn. This is why my client exactly wants that additional sidebox in right column:
Example Link
You will notice right "sidebox" named Parts, which is showing type of spare parts (engine, brakes, suspension...) for current selected model, so user can easly switch for exam. from Engine Parts to Suspension for his car model.
ps. Example link takes time to open, but site is working:bigups:
After looking at the Milner site, I have thought of a simple way to get the desired categories boxes/levels.
1: Set the active/level filter to show all first level subcats (as it is now) plus the lower subcats of the active main cat. (It may take a customized version of the active/level managing function - not a big deal.)
2: Activate both the chcategories sidebox as is, and the categories sidebox on the right.
3: Make stylesheet rules that will hide lower subcats in the chcategories box and first level cats in the categories box.
Hey there,
What are the css commands that can be given to a group to style it? For example in my style sheet I have:
ul#catGroup6_8 {
border: 1px solid #ff0505;
background-color:#000099;
background-image:url(../images/DeliveryVan.gif);
margin-left:20px;
margin-bottom:25px;
height:200px;
}
of the above only the border and height actually do as they are told. I've messed about with padding, margins, bg colors etc (altho fontsize and width also work). Is there a limit to what types of commands you can make a group do? Or am I missing something. It is late after all...
Great mod btw, hadn't realised how unflexable the default zencart cat sidebox was!
Hello,
Is this module compatible with HideCategories?
Thanks
See posts 1136 and 1137 in this thread.
Sorry, forgot that I had already made a post.
That file exist in the hideCategories module. How do I merge them?
Thanks
Im getting the HideCategories to work but all the Individual Category Headings has disappeared.
Got it to work now :)
Is it possible to enter any links and have it displayed in the Categories Sidebox? For example, add a link to Privacy Notice and have that display at the bottom of the Categories Sidebox?
You could add that as a heading for one of the links at the bottom of the sidebox, styled to look like another link.
Alternatively, you could edit tpl_categories.php and put the link code there to get it at the very bottom of the sidebox.
sorry for delay in reply again, I had to make necessary changes on site design in meantime, on my client suggestion:bigups:
I forgot to menition that sidebox I set-up on left side on my page is classic categories.php (which is now showing only 1st level subcategories). So I dont know if that changes situation to-much beside left/right position :huh:
This I have finished, with note that categories.php (which is showing Car Brands) is on left and chcategories.php (which is showing Car Part Type) is in the right columnQuote:
2: Activate both the chcategories sidebox as is, and the categories sidebox on the right.
This is part I having trouble with.. In "categories_dressing_defines.php" display level looks like this:Quote:
3: Make stylesheet rules that will hide lower subcats in the chcategories box and first level cats in the categories box.
"define('CAT_BOX_ACTIVE_LEVEL', '0|1|1');"
and that OK regarding left sidebox categories.php, but how can I set chcategories to display level '0|5|4' at same time?
And also I dont understand part about stylesheet rules which will hide lower subcats in the chcategories?
Is it not possible to have margins or padding or have a background image set in a ul#catGroup?
I can make borders, adjust fonts, set the height and width of the group but I can't position anything properly :(
At least if I knew it wasn't possible I could give up trying and have a go at something else.
adi2009 - My last post to you was specific about the location of categories and chcategories. It won't work correctly with them the other way. And you won't need to have two different settings, once a small change is made to a function in categories_dressing_functions.php. Essentially we need to make the code treat first level subcats as if they were top level cats. I will look at that soon and post the change required.
The stylesheet code will be something like
#chcategories ul ul ul {/*hide all deeper than first subcategory lists - left box*/
display: none;
}
#categoriesContent>ul>li>ul>li>a {/*hide only first level subcategories - right box*/
display: none;
}
In /includes/functions/extra_functions/categories_dressing_functions.php, find thisand add this just before itPHP Code:
}//switch
if ($test_level){
switch ('true'){
case ($cat_box_active_level[1] > $cat_depth):
to get thisPHP Code:
case 7://full active subtree, others per level - treat first subcat like top - customized 20100205 for madijelovi
if($cPath_top != $path_top){//only 1 top cat's subs
$skip_cat = 1;
break;
}
$cPath_top_special = (int)substr_replace($_GET['cPath'],'',0,strpos($_GET['cPath'],'_')+1) ;//remove before & incl 1st occurrence of _ in string
$path_top_special = (int)substr_replace($path,'',0,strpos($path,'_')+1) ;//remove before & incl 1st occurrence of _ in string
if($cPath_top_special != $path_top_special) $test_level = 1;
break;
I haven't tested this, and you may need something slightly different, but it will be similar. Let me know what happens.PHP Code:
case 7://full active subtree, others per level - treat first subcat like top - customized 20100205 for madijelovi
if($cPath_top != $path_top){//only 1 top cat's subs
$skip_cat = 1;
break;
}
$cPath_top_special = (int)substr_replace($_GET['cPath'],'',0,strpos($_GET['cPath'],'_')+1) ;//remove before & incl 1st occurrence of _ in string
$path_top_special = (int)substr_replace($path,'',0,strpos($path,'_')+1) ;//remove before & incl 1st occurrence of _ in string
if($cPath_top_special != $path_top_special) $test_level = 1;
break;
}//switch
if ($test_level){
switch ('true'){
case ($cat_box_active_level[1] > $cat_depth):
You will want a define setting of '7|4|5' ; change the 4 and 5 if needed, but you must use the 7.
zubenubi - All of the styling you want should be possible. Post a link to see your site so I can advise.
"Apart from hard-coding it in the tpl_categories.php, is there other way to have a group of links (around 10 manufacturer links) to show as a category sidebox without creating the folders in admin?"
You can code the links into a "heading" for a category or link in categories_dressing_defines.php, or hard-code them in tpl_categories.php.
You might be able to use the manufacturers sidebox, remove its heading, and make it stick tight to the bottom of the categories box so it looks continuous (all with CSS), or put the mfr links in the ez-page sidebox and do the same.
We wont be able to use the manufacturer sidebox as we have over 50 manufacturers and we are only picking the top 10 most popular to show on a sidebox.
Im not sure how to code the links into a heading in categories_dressing_defines.php. Could you please give me an example. I thought all the headings are just static. Below is what we have in the categories_dressing_defines.php
define ('CAT_BOX_HEADING_309','1|0|||Popular Phone Brands|1||');
define ('CAT_BOX_HEADING_19','1|0|||Popular Series|1||');
Thanks...
The headings will be output as HTML, so you can code a link into a heading text section.
All of these links will appear above category 23, and can be styled using .catBoxHeading2 {} and .catBoxHeading2 a {}.PHP Code:
define ('CAT_BOX_HEADING_23','1|0|||<a href="your desired address1">Manufacturer 1</a>|2|<a href="your desired address2">Manufacturer 2</a>|2|<a href="your desired address3">Manufacturer 3</a>|2');
For internal links, use href="index.php?main_page=whatever&manufacturerId=whatever", or however the URL looks when you are on the desired page.
Hello there,
Greeings!!
I have installed Categories Dressing to show the subcategories always in the sidebox. I used 'CAT_ACTIVE_LEVEL' to show the categories and subctegories at level one. Problem is with it hides the 2nd level subcategory. I don't want to hide it.
Instead
I need to always show master categories and subactegory level 1 and by click on subactegory1 it shows me subcategories at level 2 in the sidebox.
It doesn't meant to hide the level 2 subcategories. i need to show 2 level categories on the click of its parent category.
Please help me to resolve this problem.
Hope u understand my need to complete this and help me.
hope to see the response soon,
Many Thanks.
You will want the define to read
define('CAT_BOX_ACTIVE_LEVEL', '4|0|1');
This will use case 4 to show the active tree, active branches only, and others per level (0|1 = top and first sub).
Note: if this doesn't work correctly, let me know and post a link to see your site. I am working from the as yet unreleased v2.8 copy of the file, and might have changed something relevant from the latest released version.
Hi Glenn, thanks for replying, Unfortunately I'm doing this all on my laptop so I can't give you a link.
I'll attach my css files if your game for taking a look but at least I know that it is possible! So I'll keep plugging away.
Really cant think what the problem is i dont think i've done anything weird, I'm sure I'm not missing semicolons or anything, I can change other variables of a group but just not margin, padding or anything to do with background.
Thanks for the reply.
The code above works but I can't seem to get it where I want it to be. I need these group of links between "Top Phone Brands" and "Popular Series" category groups and need this to have a heading as well. Link to the site is www.playnippon.com
That is doable.
Add another heading "|Manufacturers|1|" in front of the manufacturers list "headings" described above, and put the whole series in front of the existing heading for category 19 (Ah My Goddess).PHP Code:
define ('CAT_BOX_HEADING_19','1|0|||Manufacturers|1|<a href="...'
When I add the above code, the Manufacturers heading appears but the "Popular Series" heading disappears because it is being replaced by the links. Below is what we have in the file.
define ('CAT_BOX_HEADING_19','1|0|||Manufacturers|1|<a href="your desired address1">Manufacturer 1</a>|2|<a href="your desired address2">Manufacturer 2</a>|2|<a href="your desired address3">Manufacturer 3</a>|2');
define ('CAT_BOX_HEADING_309','1|0|||Top Phone Brands|1||');
define ('CAT_BOX_HEADING_19','1|0|||Popular Series|1||');
You need to merge the two defines for category 19.Sorry if that wasn't clear. A constant can only be defined once, and any additional defines will be ignored.PHP Code:
define ('CAT_BOX_HEADING_19','1|0|||Manufacturers|1|<a href="your desired address1">Manufacturer 1</a>|2|<a href="your desired address2">Manufacturer 2</a>|2|<a href="your desired address3">Manufacturer 3</a>|2|Popular Series|1||');
That did it!!! Thanks so much!!!
Appreciate the help!!!
Uhmm...sorry for the trouble.
Another question, can you only add 1 group of links? Or can I duplicate the above and have another group of links below or above the Manufacturers?
There is theoretically no limit to the number of different link "heading" groups you can add to a category in this manner. They just all have to be in the one define statement.
That is a very nice implementation of the heading function... it's satisfying to see some of the features I built being used to their fullest.
I see...so you can only have 1 define per category number.
Just wondering, how do I get hover effect for the headings the same as normal category links? At the moment, we are only getting text-hover effect.
Lastly, how do I add white space at the bottom of each group?
Thanks for this great mod! :)
Managed to get the space issue done by changing the style for the Popular Series heading.
Only issue left is the hover effect. Need the hover to be the whole block instead of just the text link.
Add to
.catBoxHeading2 a {
display: block;
}
Added the above but the hover still only affect the text instead of the whole block like in the "popular series" sidebox. I also added code below but didn't made any difference.
.catBoxHeading2 a:hover {background:#ffffff url(../images/bc_cat_no_sub_hover.gif) no-repeat;}
...holding...
Your compressed CSS seems to have eliminated a lot of the stylesheet_categories_dressing.css entries, and I don't see the .catBoxHeading2 a:hover {} rule at all, unless that is somewhere else in the compressed mass of code.Code:* html #categories li, * html #categories li a{height:1em;background-image:url(/includes/templates/custom/images/pixel_trans.gif)}
.catBoxHeading1{font-family:tahoma,arial,helvetica,verdana;font-weight:bold;color:#fff;background-image:url(/includes/templates/custom/images/sideheader_bg.gif);padding:5px 0 8px 19px;margin:0}
.catBoxHeading2{font-family:tahoma,arial,helvetica,verdana;color:#fff;padding:0;margin:0}
.catBoxHeading3{font-family:tahoma,arial,helvetica,verdana;font-weight:bold;color:#fff;background-image:url(/includes/templates/custom/images/sideheader_bg.gif);padding:5px 0 8px 19px;margin-top:9px}
.catBoxHeadingImg{padding:0;margin:0}
#categories ul{list-style:none;background:none;border:none;margin:0 0 9px 0;padding:0}
#categories ul a{display:block;background:#f0f0f0 url(/includes/templates/custom/images/bc_cat_no_sub.gif) no-repeat;border-top:2px solid #fff;border-bottom:1px solid #cfd9e2;padding:1px 0 4px 20px}
#categories li.cat-top a:hover{background:#fff url(/includes/templates/custom/images/bc_cat_no_sub_hover.gif) no-repeat}
I removed the entries that are not being used (i.e. subcategories).
I have entered the .catBoxHeading2 a:hover now but still nothing happens. No changes in the hover effect.
It needs some more specificity to overcome some other rule. Add #categoriesAlso, if you are deleting unused rules, what about .catBoxHeading3 and .catBoxHeadingImg?Code:#categories li.cat-top a:hover, #categories .catBoxHeading2 a:hover{background:#fff url(/includes/templates/custom/images/bc_cat_no_sub_hover.gif) no-repeat}