Hi Glenn
That would be great! I have had a look around and can't find the code for this - if you could point us in the right direction that would be cool!
Cheers ! Happy Easter![]()
Hi Glenn
That would be great! I have had a look around and can't find the code for this - if you could point us in the right direction that would be cool!
Cheers ! Happy Easter![]()
no worries - found it
http://www.zen-cart.com/forum/showthread.php?t=46337
:-)
Great! That code can even be simplified a bit, because the category image name is available directly in that file as $box_categories_array[$i]['image'] instead of having to run around looking it up.
So instead ofyou can usePHP Code:
// for adding image beside category name
// categories_image
$categorySelect = str_replace('cPath=','',$box_categories_array[$i]['path']);
$categories_image = zen_get_categories_image($categorySelect);
$myCategoryImage = zen_image(DIR_WS_IMAGES . $categories_image, '', '50', '75');
// categories_image
$content .= $myCategoryImage;
// end adding image code
PHP Code:
// for adding image beside category name
// categories_image
$myCategoryImage = zen_image(DIR_WS_IMAGES . $box_categories_array[$i]['image'], '', '50', '75');
// categories_image
$content .= $myCategoryImage;
// end adding image code
Hello,
This MOD is excellent, but all i want is to add an image of a line between each item listed in the category menu.
i am not sure what should i remove or add in the dressing files to achieve this?
any thoughts?
As described in the readme, find this section in tpl_categories.phpand put the ids of all of your top categories in the list.PHP Code:
// categories dressing - add divider above specified cats
if(in_array($current_path, explode(",",'3,22,21_56'))) { //replace numbers with your cat ids separated by commas
$content .= '<hr class="catBoxDivider" />' . "\n";
}
Dear Glenn:
After sending you the PM, I am a little confused myself...But, I am trying to use images for the category names in the Categories - Tabs Menu header via the use of Categories Dressing v2.1.
I currently have Alternative Header v1.1a installed, which places the links for login, shopping cart and my account into the image header rather than on a bar. It also centers the header search box. (I believe it is also supposed to create a tabbed categories menu above the header search box. However, my install just shows the standard Zen Categories - Tabs Menu.
From some of your posts, I believe that I can use Categories Dressing to effect the use of images in place of text for the category names in the Categories - Tabs Menu - by copying the "relevant code" from tpl_categories.php to tpl_header.php (which comes from Alternative Header 1.1a). However, I do not know what the "relevant code" is.
Per your request for code, hopefully the following is meaningful:
The code from Alternative Header v1.1a's ...includes/templates/CUSTOM/common/tpl_header.php, which references categories tabs is as follows:
The code for ...includes/templates/CUSTOM/templates/tpl_modules_categories_tabs.php, which is referenced in tpl_header.php is as follows:Code:<!--bof-optional categories tabs navigation display--> <?php require($template->get_template_dir('tpl_modules_categories_tabs.php',DIR_WS_TEMPLATE, $current_page_base,'templates'). '/tpl_modules_categories_tabs.php'); ?> <!--eof-optional categories tabs navigation display-->
I hope this is a clearer description of my objectives/issues.Code:<?php include(DIR_WS_MODULES . zen_get_module_directory(FILENAME_CATEGORIES_TABS)); ?> <?php if (CATEGORIES_TABS_STATUS == '1' && sizeof($links_list) >= 1) { ?> <div id="navCatTabsWrapper"> <div id="navCatTabs"> <ul> <?php for ($i=0, $n=sizeof($links_list); $i<$n; $i++) { ?> <li><?php echo $links_list[$i];?></li> <?php } ?> </ul> </div> </div> <?php } ?>
Thanks for your help. . Newbie Linda
The file to edit will be /includes/modules/your_template/categories_tabs.php, as this is where the output is originally built.
It shouldn't be too hard to adapt the Cat Dressing code to this. I'll look at it and get back.
Free Call Stuff A Top Level Cat
SubLevel 2 A
SubLevel 2 B
Sub Sub Cat 2B1
Sub Sub Cat 2B2
Sub Sub Cat 2B3
SubLevel 2 C
this mod is great! but when my zc have 3 sublevel Categories ,how hide 3 sub_categories :example Sub Sub Cat 2B1 etc...
thanks.
You're saying you never want to show the links for level 3 or deeper subcats in the sidebox?
You can do that by finding this in tpl_categories.phpand addingPHP Code:
$current_path = str_replace("cPath=","",$box_categories_array[$i]['path']);
if (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 {
(substr_count($current_path,'_') > 2) or
to getThe number of underscores _ in $current_path equals the subcat level.PHP Code:
$current_path = str_replace("cPath=","",$box_categories_array[$i]['path']);
if ((substr_count($current_path,'_') > 2) 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) or deeper than level 2 subcat
} else {
Hello, I just recently installed this contrib so that I can use image links in place of text category links, and for the hover image swaps.
This contrib works perfectly for my needs except for one part, which I'm not sure of how to code. I would like the hover image to remain in it's hover state when browsing the corresponding category. And when the user clicks another category, the image reverts back to it's normal state.
Any help is welcome and thanks for the great mod. The readme.txt is very in-depth.. as if the code wasn't self-explanetory enough![]()
Bookmarks