Zen Cart Logo
Forums / Addon Sideboxes / Categories Dressing

Categories Dressing

Views: 531,648

Results 1,141 to 1,160 of 2,268
14 Jan 2010, 3:48 PM
#1141
gjh42 avatar

gjh42

Black Belt

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

Categories Dressing

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:```php
define ('CAT_BOX_HEADING_107','1|0|||<a href="index.php?main_page=page&id=5">Design</a>|1');

Change the 5 to whatever the ez-page id is.
You don't need to change your stylesheet.
25 Jan 2010, 2:33 AM
#1142
giftpackaging avatar

giftpackaging

New Zenner

Join Date:
May 2009
Posts:
22
Plugin Contributions:
0

Re: Categories Dressing

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

25 Jan 2010, 3:51 AM
#1143
gjh42 avatar

gjh42

Black Belt

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

Re: Categories Dressing

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?

25 Jan 2010, 4:14 AM
#1144
gjh42 avatar

gjh42

Black Belt

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

Re: Categories Dressing

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 : ```
define('CATEGORIES_BOX_HEADING_SPECIALS','Specials ...');

define('CATEGORIES_BOX_HEADING_SPECIALS',zen_image(DIR_WS_TEMPLATE . 'buttons/' . $_SESSION['language'] . '/catimgspecials.gif', 'Specials') );

If the zen_image() function doesn't give the right results here, try

define('CATEGORIES_BOX_HEADING_SPECIALS','<img src="' . DIR_WS_TEMPLATE . 'buttons/' . $_SESSION['language'] . '/catimgspecials.gif" alt="Specials" />');

Save the image as
/includes/templates/your_template/buttons/english/catimgspecials.gif
25 Jan 2010, 4:39 AM
#1145
gjh42 avatar

gjh42

Black Belt

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

Re: Categories Dressing

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 thisphp 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"; } } to this```php
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
}
}

Not tested yet, but this should use the image at
/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.
25 Jan 2010, 4:48 AM
#1146
gjh42 avatar

gjh42

Black Belt

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

Re: Categories Dressing

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).```php
//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

This will give a classname of .category-links for images and .category-links-text for text.
25 Jan 2010, 6:09 AM
#1147
giftpackaging avatar

giftpackaging

New Zenner

Join Date:
May 2009
Posts:
22
Plugin Contributions:
0

Re: Categories Dressing

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.

25 Jan 2010, 6:54 AM
#1148
gjh42 avatar

gjh42

Black Belt

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

Re: Categories Dressing

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
none```
/different bullet for links if desired/

#categories li a.category-links {
list-style: none;
}

I will test the code and post a working version later.
25 Jan 2010, 4:17 PM
#1149
ecotopia avatar

ecotopia

New Zenner

Join Date:
Oct 2009
Posts:
19
Plugin Contributions:
0

Re: Categories Dressing

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.

25 Jan 2010, 4:21 PM
#1150
gjh42 avatar

gjh42

Black Belt

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

Re: Categories Dressing

You are using BetterCategories, not Categories Dressing, so you need to ask in that mod's support thread.

27 Jan 2010, 2:18 AM
#1151
giftpackaging avatar

giftpackaging

New Zenner

Join Date:
May 2009
Posts:
22
Plugin Contributions:
0

Re: Categories Dressing

Thanks Glenn - that has worked perfectly.

30 Jan 2010, 1:42 AM
#1152
amyleew avatar

amyleew

Zen Follower

Join Date:
Jul 2009
Posts:
159
Plugin Contributions:
0

Re: Categories Dressing

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.

30 Jan 2010, 2:24 AM
#1153
gjh42 avatar

gjh42

Black Belt

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

Re: Categories Dressing

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.

30 Jan 2010, 2:48 AM
#1154
amyleew avatar

amyleew

Zen Follower

Join Date:
Jul 2009
Posts:
159
Plugin Contributions:
0

Re: Categories Dressing

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.

30 Jan 2010, 3:12 AM
#1155
gjh42 avatar

gjh42

Black Belt

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

Re: Categories Dressing

There are also demo screenshots in posts 500-510, showing more features the mod is capable of.

1 Feb 2010, 6:49 PM
#1156
adi2009 avatar

adi2009

New Zenner

Join Date:
Dec 2009
Location:
Sarajevo
Posts:
80
Plugin Contributions:
0

Re: Categories Dressing

connected to my last post regarding cetegories in my left sidebox I am switching to this thread:wink:

"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! "

@Glenn

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?

1 Feb 2010, 7:27 PM
#1157
gjh42 avatar

gjh42

Black Belt

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

Re: Categories Dressing

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?

1 Feb 2010, 7:55 PM
#1158
adi2009 avatar

adi2009

New Zenner

Join Date:
Dec 2009
Location:
Sarajevo
Posts:
80
Plugin Contributions:
0

Re: Categories Dressing

thank you for promt reply Glenn, really appreciate it

gjh42:

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.

no, its OK, for start I will use only one sidebox - ch_categories.php

You have the standard categories sidebox at the top left, and the chcategories sidebox below it. Do you want both of them displayed?

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?

1 Feb 2010, 8:18 PM
#1159
adi2009 avatar

adi2009

New Zenner

Join Date:
Dec 2009
Location:
Sarajevo
Posts:
80
Plugin Contributions:
0

Re: Categories Dressing

gjh42:

What is your current setting for
define('CAT_BOX_ACTIVE_LEVEL', '#|#|#')

sorry I forgot to answer this one:blush:

code from file "categories_dressing_functions.php"

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;
}
1 Feb 2010, 8:20 PM
#1160
gjh42 avatar

gjh42

Black Belt

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

Re: Categories Dressing

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.