If this is your first visit, check our documentation. To post, register or login.

Categories Dressing

Started by gjh42 on 6 Jun 2007, 7:25 PM · Views: 532,942

Results 2,161 to 2,180 of 2,268
7 Dec 2012, 5:05 AM
#2161
sports_guy avatar

sports_guy

Totally Zenned

Join Date:
Apr 2007
Location:
Dayton, Ohio
Posts:
682
Plugin Contributions:
0

Post #2161 by sports_guy

If all of this stays:

$content .= cat_box_subtext($current_path);
    }
  }
  $content .= cat_ul_manage(0, $prev_cat_depth, 0) . '</ul>' . "\n";
    
  if (SHOW_CATEGORIES_BOX_SPECIALS == 'true' or SHOW_CATEGORIES_BOX_PRODUCTS_NEW == 'true' or SHOW_CATEGORIES_BOX_FEATURED_PRODUCTS == 'true' or SHOW_CATEGORIES_BOX_PRODUCTS_ALL == 'true') {
// display a separator between categories and links

Making this the last line of replaced code:

$content .= '</a>';

The page is showing all main links as bold text only. No subcategories, not styling, and no hidden categories. You can see it live here: http://www.lasilhouettelingerie.com/store/accessories-c-193/

I was able to use Beyond Compare to merge changes. All the items in red, are said differences that were merged into my file:


$skip_cat = 0;
$skip_cat = cat_active_level_manage($current_path);
$cat_depth = substr_count($current_path,'_');//no top cat link
if ($skip_cat 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 {
$cat_box_heading = cat_box_heading($current_path);
$cat_ul = cat_ul_manage($current_path, $prev_cat_depth, $cat_box_heading[0]);
$content .= $cat_ul;
$content .= $cat_box_heading[1];
$cat_name_display = cat_name_display($box_categories_array[$i]['name'], $current_path);
$active_class = ($box_categories_array[$i]['current'])? ($box_categories_array[$i]['has_sub_cat']? 'parent': 'selected'): 'not-selected';
//$content .= ' <li class="cat-' . $new_style . '"><a class="cat-' . $active_class . $cat_name_display[0] . '" href="' . zen_href_link(FILENAME_DEFAULT, $box_categories_array[$i]['path']) . '">';
if ($cat_depth == 0) {//no top cat link
$content .= str_repeat(' ',$cat_depth) . ' <li class="cat-' . $new_style . '"><span class="cat-' . $active_class . $cat_name_display[0] . '">';
} else {
$content .= str_repeat(' ',$cat_depth) . ' <li class="cat-' . $new_style . '"><a class="cat-' . $active_class . $cat_name_display[0] . '" href="' . zen_href_link(FILENAME_DEFAULT, $box_categories_array[$i]['path']) . '">';
}//no top cat link

$content .= $cat_name_display[1];
if ($box_categories_array[$i]['has_sub_cat'] and $cat_name_display[0] == '-text') {
$content .= CATEGORIES_SEPARATOR;
}

  if (SHOW_COUNTS == 'true' and $cat_name_display[0] == '-text') {
    if ((CATEGORIES_COUNT_ZERO == '1' and $box_categories_array[$i]['count'] == 0) or $box_categories_array[$i]['count'] >= 1) {
      $content .= '<span class="catCount">' . CATEGORIES_COUNT_PREFIX . $box_categories_array[$i]['count'] . CATEGORIES_COUNT_SUFFIX . '</span>';
    }
  }
  //$content .= '</a>';
  if ($cat_depth == 0) {//no top cat link
  $content .= '</span>';
  } else {

$content .= '</a>';
}//no top cat link
}
}
$content .= cat_ul_manage(0, $prev_cat_depth, 0) . '</ul>' . "\n";

if (SHOW_CATEGORIES_BOX_SPECIALS == 'true' or SHOW_CATEGORIES_BOX_PRODUCTS_NEW == 'true' or SHOW_CATEGORIES_BOX_FEATURED_PRODUCTS == 'true' or SHOW_CATEGORIES_BOX_PRODUCTS_ALL == 'true') {
// display a separator between categories and links


Something seems to be breaking the styling from the page.

Building a better web, one site at a time: Dayton Web Design

7 Dec 2012, 8:45 AM
#2162
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,874
Plugin Contributions:
8

Post #2162 by gjh42

I am using the Collapseable Categories Tree. I would like it so, when the main category is clicked the tree expands which exposes all the sub-categories. Did you install the Uncollapsed Categories Tree files? You are not using that option, and you don't have stylesheet_chcategories.css which you would need to style the sidebox in that case. You cannot expand full trees without chcategories.

The added code can only affect whether a category is a link or not. Changing the top cats from <a> to <span> elements could affect styling, as anything which referenced "a" elements will no longer apply. Duplicate those rules and change a to span.

7 Dec 2012, 2:55 PM
#2163
sports_guy avatar

sports_guy

Totally Zenned

Join Date:
Apr 2007
Location:
Dayton, Ohio
Posts:
682
Plugin Contributions:
0

Post #2163 by sports_guy

gjh42:

Did you install the Uncollapsed Categories Tree files? You are not using that option, and you don't have stylesheet_chcategories.css which you would need to style the sidebox in that case. You cannot expand full trees without chcategories.

Yes this is where the problem is most likely going to lie. I did not install the uncollapsed tree (and therefore the stylesheet_chcategories.css) because for my use I need these to be collapse-able. The reason I need them collapse-able is I have way to many sub-categories. In the Shop by Designer category alone I have 47 sub-categories, so having these show sub-categories permanently is not good for my shop.

So my plan was to keep it a collapse-able tree, keep the top categories click-able, but does not redirect the corresponding category URL. But does still open to display sub-categories. So clicking the top categories in this collapse-able category tree, will only open and show the subcategories and nothing else.

(For now I am going to change it back to the way it was)

With my needs, am I missing the point of your statement above?

Building a better web, one site at a time: Dayton Web Design

7 Dec 2012, 4:56 PM
#2164
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,874
Plugin Contributions:
8

Post #2164 by gjh42

The Uncollapsed Categories can be made collapseable with a few stylesheet rules (generally used for making it a flyout menu). The stock categories menu can only show the immediate active part of the subcat tree, when what I understand you want is all subcats, sub-subcats, etc. of the open top cat.

If the top categories are made not links, they are no longer clickable and cannot cause any action. What was the reason you do not want to be able to use the top cats as links?

13 Dec 2012, 8:23 PM
#2165
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,874
Plugin Contributions:
8

Post #2165 by gjh42

So clicking the top categories in this collapse-able category tree, will only open and show the subcategories and nothing else. For this functionality, you need javascript. You would have to write any such script yourself, or find one you could adapt.

CSS and the uncollapsed option can easily turn the categories into a flyout menu which will show relevant subcats on hover.

2 Feb 2013, 1:13 PM
#2166
busymom avatar

busymom

New Zenner

Join Date:
Jul 2007
Posts:
61
Plugin Contributions:
0

Post #2166 by busymom

gjh42:

The one real bug it had only happened in IE7, so is pretty much irrelevant now.

Glenn, if this was the only bug keeping you from releasing V2.8, are you willing to make it live yet? In browsing through a bunch of pages of posts since the post where you released the Beta code, you indicated that you made some additional changes to your development version (links comes to mind). I'm just pulling this mod into a new site build and would like to start with the new stuff in V2.8.

Would also like to verify that either V2.7.3 or V2.8 are drop-in compatible with ZC 1.5.1. The tpl_categories.php were so different, I haven't yet verified that the differences were due to changes you made for functionality vs. ZC code level changes due to the ZC has migrated since the last time I worked with ZC 1.3.8 on a development site!

Thanks! Karen

2 Feb 2013, 3:50 PM
#2167
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,874
Plugin Contributions:
8

Post #2167 by gjh42

Either v2.7.3 or v28 will work with ZC v1.5.x, as tpl_categories.php has not changed in at least 5 years, maybe more.

There was one coding tweak I made to account for correct <ul> nesting in a rare case of subcategory display, and I have not set up the conditions to test that yet. Other than that, v2.8 is useable now, and I could post or send a current copy in a few days when I finish some urgent work. I do want to get that final test out of the way so I can update the mod in Plugins.

2 Feb 2013, 6:44 PM
#2168
uncharted avatar

uncharted

New Zenner

Join Date:
Oct 2011
Posts:
68
Plugin Contributions:
0

Post #2168 by uncharted

Hi Glen,

Are there any extra features for version 2.8?

Best Regards

4 Feb 2013, 1:27 AM
#2169
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,874
Plugin Contributions:
8

Post #2169 by gjh42

v2.8 (added easier special category styling, image type setting, image function for links, optional flyout styling)

You can single out any category name for special styling, by adding a define in categories_dressing_defines.php instead of the old method of adding cases in tpl_categories.php.

You can reset the image extension used for image replacements with one define, instead of editing several PHP statements in other files.

The image replacement feature now works for all/special/new/featured links as well as category names.

Stylesheet rules for turning the expanded categories version into a flyout menu are included in the stylesheet, and only need to be uncommented to be used.

And some miscellaneous improvements to coding, and one or two new stock choices for varieties of category/subcategory level visibility.

4 Feb 2013, 8:36 AM
#2170
busymom avatar

busymom

New Zenner

Join Date:
Jul 2007
Posts:
61
Plugin Contributions:
0

Post #2170 by busymom

gjh42:

Stylesheet rules for turning the expanded categories version into a flyout menu are included in the stylesheet, and only need to be uncommented to be used.

Hi Glenn, FYI I think that this isn't in the beta version you had released. I've added flyouts using the three or so posts that you had instructions in, but I don't think the stylesheet that came in the beta 2.8 had this in it. I suspect it is one of the tweaks you've put into your development version since making the beta download available.

Flyouts are exactly what my next question was about. So I've tried a few different versions of the flyouts to see what works best for me and I think I'm actually looking for some kind of hybrid. I suspect it is do-able, I just can't put my head around the right incantation of what to change. Right now I have a couple of top categories that have two sub-cat levels, a few with only a single sub-cat level, and (intentionally) the bottom one with no sub-cat levels which has a header image. At first I thought that having just the top level cats showing in the listing by default looked too minimal, so I added the special flyout code to only show flyouts for the 2nd sub-cat level and always showing the top and 1st sub-cat levels. What happened when I did that, though, is my image for the last category moved below the fold. For my front page, I'd really like to keep that image at least partially above the fold, so I want to go back to all sub-cat flyouts when there is no active selection. Once a level has been selected, though, meaning there is now an active tree, I'd like to expand the displayed listing to include the active levels or tree. At this point, I feel like I've grabbed the potential customer interest enough that I don't mind the image moving below the fold with the expanded cats taking up more vertical space. The flyouts can still function the way they did before displaying the active tree, or they can just function relative to the expanded cats - this part doesn't matter to me so much - but I want to be able to show the active tree.

If the flyout / active level code isn't easily tweaked to allow this, one possible solution that is in the back of my mind is to use the flyouts with ch_categories sidebox when on the main page, but once navigated into the store, switch to the main categories sidebox which shows the expanded categories approach. Any ideas/thoughts on how to accomplish what I'm looking to do?

Thanks - Karen

4 Feb 2013, 4:58 PM
#2171
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,874
Plugin Contributions:
8

Post #2171 by gjh42

I think per-page stylesheets will be the best way to get what you want. Make a file index_home.css with rules that override the subcat flyout as desired; this will only be loaded for the homepage. You can also make other stylesheets with the same rules for any other pages where you want the flyouts modified, according to the notes in /includes/templates/template_default/css/CSSreadme.txt (it may be under /classic/ depending on your ZC version).

4 Feb 2013, 8:16 PM
#2172
berserker avatar

berserker

Totally Zenned

Join Date:
May 2006
Posts:
712
Plugin Contributions:
0

Post #2172 by berserker

gjh42:

v2.8 (added easier special category styling, image type setting, image function for links, optional flyout styling)

You can single out any category name for special styling, by adding a define in categories_dressing_defines.php instead of the old method of adding cases in tpl_categories.php.

You can reset the image extension used for image replacements with one define, instead of editing several PHP statements in other files.

The image replacement feature now works for all/special/new/featured links as well as category names.

Stylesheet rules for turning the expanded categories version into a flyout menu are included in the stylesheet, and only need to be uncommented to be used.

And some miscellaneous improvements to coding, and one or two new stock choices for varieties of category/subcategory level visibility.

Awesome. Can I try it out?

4 Feb 2013, 9:34 PM
#2173
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,874
Plugin Contributions:
8

Post #2173 by gjh42

I hope the zip is not too big to attach correctly. If it works, here it is, minus the GPL license file as that adds a big chunk to it.

Please let me know about your experience so I can make any necessary corrections/improvements before submitting to Plugins.

4 Feb 2013, 9:56 PM
#2174
berserker avatar

berserker

Totally Zenned

Join Date:
May 2006
Posts:
712
Plugin Contributions:
0

Post #2174 by berserker

Thank you. Will try it out now :)

9 Feb 2013, 5:21 PM
#2175
berserker avatar

berserker

Totally Zenned

Join Date:
May 2006
Posts:
712
Plugin Contributions:
0

Post #2175 by berserker

Hello,

Tested it on 1.5.1 and getting a blank page. It says there's a syntax error on line 14 of categories_dressing_functions.php.

9 Feb 2013, 7:52 PM
#2176
berserker avatar

berserker

Totally Zenned

Join Date:
May 2006
Posts:
712
Plugin Contributions:
0

Post #2176 by berserker

Back on using the old version for now, how do you turn off the ch_categories sidebox in the homepage but on for other pages?

11 Feb 2013, 7:11 PM
#2177
gjh42 avatar

gjh42

Black Belt

Join Date:
Jul 2005
Location:
Upstate NY
Posts:
21,874
Plugin Contributions:
8

Post #2177 by gjh42

That would take an if() test in /includes/modules/sideboxes/your_template/ch_categories.php wrapped around the entire file code content, like this:```
if (!$this_is_home_page) {
//the file code
}


The PHP error is a typo in the file (obviously not debugged since the last time I worked on it). I spent a good while trying to see what was wrong with
        $new_style = constant('CAT_SPECIAL_CATEGORY_' . $path);
before realizing that I had left the colon : off of the preceding line. It should be
  case (defined('CAT_SPECIAL_CATEGORY_' . $path)):
    $new_style = constant('CAT_SPECIAL_CATEGORY_' . $path);
There is another typo in that file. In this: ```php
function cat_path_common_parent($path1,$path2) {
  $parent_paths1 = explode('_',$path1);
  $parent_paths2 = explode('_',$path2);
  for($i=0;$i=max(count$parent_paths1,count$parent_paths2)-1;$i++){
``` the last line (line 37) should have parentheses around the count() arguments. Not sure how I forgot that one...```php
  for($i=0;$i=max(count($parent_paths1),count($parent_paths2))-1;$i++){

And finally, at line 132:php if ($new_group) { $path_parents = cat_path_common_parent($prev_path,$current_path); // $path_parents[0][$i] $path_parents[1] ) the last parenthesis ) should be a curly brace }```php
if ($new_group) {
$path_parents = cat_path_common_parent($prev_path,$current_path);
// $path_parents[0][$i] $path_parents[1]
}

I really need new glasses :) to see little letter quirks better...
13 Feb 2013, 7:45 PM
#2179
busymom avatar

busymom

New Zenner

Join Date:
Jul 2007
Posts:
61
Plugin Contributions:
0

Post #2179 by busymom

Glenn, I tried using the index_home stylesheet approach that you suggested. It was a simple and elegant solution which never crossed my mind (been away too long, I guess :ohmy:) I had it working as far as the flyouts went, but when I started mucking with the way I wanted it to look the rest of the time, the flyouts stopped working and I haven't been able to get them working again since then. I suspect it has something to do with my active setting in the defines more so than the stylesheet changes. Since I was satisfied with the way I changed things, I dropped trying to get the flyouts working, but since I see you were getting ready to release the new code, I wanted to bring this to your attention in case it was the active levels that broke it for me. I am not at my development computer right now, so can't give you the levels I am using, but functionally I have the top levels showing always and then I have all the 1st level subcats for only the active top level and all the 2nd level subcats only for the active subcat level. I am still having problems with getting one of the top cats to look the way I want, but that is for a different post. The top cats with subcats are all looking the way I want, but the flyouts won't work anymore.

Let me know if you need more details from my defines or stylesheets to test that your new code for flyouts before you release it for the plugins.
Thanks! Karen

13 Feb 2013, 7:57 PM
#2180
busymom avatar

busymom

New Zenner

Join Date:
Jul 2007
Posts:
61
Plugin Contributions:
0

Post #2180 by busymom

Along the same lines of what Berserker wants to do... I've got one ezpage hierarchy where I don't want the cats to show at all. I do want the sidebox title to show as a link to a page where my categories would normally show. I figure if I needed to, I can probably duplicate the sidebox title look as an ezpage link that replaces the ch_categories sidebox when I'm in this particular ezpage hierarchy and then I wouldn't have to turn off display of all the cats, but was wondering if there is a better way utilizing the power of CD to do this. I could make a linkable header that resides below the sidebox title if all the other cats are off, but I still need to have a way to control the linkable header based on the pagename. In the pagename.css I would need a .categories or #chcategories override that sets display: none blanket to cover all the ul and li conditions.

Thanks, Karen