Zen Cart Logo
Forums / Addon Sideboxes / Categories Dressing

Categories Dressing

Views: 531,486

Results 401 to 420 of 2,268
2 Sep 2008, 10:06 AM
#401
nilsen avatar

nilsen

New Zenner

Join Date:
Aug 2008
Posts:
33
Plugin Contributions:
0

Categories Dressing

Hi Glenn,
thanks a lot, but I'm a bit confused now: I have a bilingual site, so I'll need different background images, but I thought I read in earlier posts that it can't be done.
What do you suggest, how can have a individual background image for each cat (with rollover) but still have it for each langauge?
can this be done? if yes, would really appriciate your help :)
thanks a million
Nili

2 Sep 2008, 11:15 PM
#402
gjh42 avatar

gjh42

Black Belt

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

Re: Categories Dressing

It certainly can be done.
You would start with code as in post 378, and extend it to the background-image section:```php
// categories dressing - category name mods
$cat_name_display = $box_categories_array[$i]['name'];
// $subcat_level = (substr_count($current_path, '_'); //strip out subcat indent
// $cat_name_display = substr_replace($cat_name_display,'',0,($subcat_level*strlen(CATEGORIES_SUBCATEGORIES_INDENT)));
$cat_img_bg = '';
// categories dressing - display image if exists for category name in current language - with title tag
if (file_exists(DIR_WS_TEMPLATE . 'buttons/' . $_SESSION['language'] . '/catimg' . $current_path . '.gif')) {
$cat_name_display = zen_image(DIR_WS_TEMPLATE . 'buttons/' . $_SESSION['language'] . '/catimg' . $current_path . '.gif', '', '', '', 'title="' . $box_categories_array[$i]['name'] . '"');
// categories dressing - 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 . '.gif')) {
$cat_name_display = zen_image(DIR_WS_TEMPLATE_IMAGES . 'pixel_trans.gif', '', '100%', '100%', 'title="' . $box_categories_array[$i]['name'] . '"');
$cat_img_bg = ' catBg' . $current_path;
} else {

Save the appropriate language bg images, all named catbg#.gif, in 
/includes/templates/your_template/buttons/language/catbg#.gif for each language.

You would then want per-language stylesheets, each to say (for example category 25):```
a.catBg25 {
    background-image: url(../buttons/yourlanguage/catbg25.gif);
    height: 30px;
    }

a.catBg25:hover {
    background-image: url(../buttons/yourlanguage/catbg25hover.gif);
    }
4 Sep 2008, 10:06 PM
#403
nilsen avatar

nilsen

New Zenner

Join Date:
Aug 2008
Posts:
33
Plugin Contributions:
0

Re: Categories Dressing

Hi Glenn,
ok, done what you did, just one question: where do i put the language specific css? can u explain what folders I need to make and where?
thanks a lot!
nils

5 Sep 2008, 5:16 AM
#404
gjh42 avatar

gjh42

Black Belt

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

Re: Categories Dressing

That would be something like norwegian_stylesheet.css, and would go in the same place as your regular stylesheet -
/includes/templates/your_template/css/norwegian_stylesheet.css.

5 Sep 2008, 11:55 AM
#405
nilsen avatar

nilsen

New Zenner

Join Date:
Aug 2008
Posts:
33
Plugin Contributions:
0

Re: Categories Dressing

:smile::smile::smile::smile:
Glenn, your a genious!
thanks a lot!!! it works like charm...
:clap:

8 Sep 2008, 1:29 PM
#406
jvanree avatar

jvanree

Zen Follower

Join Date:
Mar 2008
Location:
Gouda, Netherlands
Posts:
211
Plugin Contributions:
0

Re: Categories Dressing

Hi Glenn,

Related to this thread http://www.zen-cart.com/forum/showthread.php?t=107314&highlight=php+categories I have some questions on categories dressing.

The way I use categories dressing right now the buttons for the categories are in my_template/buttons/dutch (or english or german)

What I need to do now is change a certain category http://www.ad-mineraal.nl/index.php?main_page=index&cPath=105 with completely different buttons. A lot of those buttons are other filenames than the ones used in the other categories but some, like the top one, will have the same catimg name but need to be of another look. (And the one that is already there still needs to exsist for other categories) I hope what I'm saying is making some sense.... it's hard for me to explain it in english.

Anyway.... do you know how to make this work?

Thanks very much in advance,

Juliet

9 Sep 2008, 2:27 AM
#407
monkeypeach avatar

monkeypeach

New Zenner

Join Date:
Jul 2008
Posts:
44
Plugin Contributions:
0

Re: Categories Dressing

Can't get my head round the readme file, so hoping you can help.

If I just wanted to change my specials link for example, to an image link what exactly do I need to do?

Thanks.

http://monkeypeach.co.uk/

9 Sep 2008, 3:31 AM
#408
gjh42 avatar

gjh42

Black Belt

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

Re: Categories Dressing

monkeypeach -

You can't find what you are looking for in the readme because it isn't there :) Categories Dressing is not written to use image replacement for the all/specials/new links. It can be done with a bit of code transplanting & modification. Find this section in tpl_categories.php:```php
if (SHOW_CATEGORIES_BOX_SPECIALS == 'true') {
//$content .= '<span class="catBoxHeading1">' . (file_exists(DIR_WS_TEMPLATE_IMAGES . 'cathead-specials.gif') ? zen_image(DIR_WS_TEMPLATE_IMAGES . 'cathead-specials.gif') . '</span>':'Link Heading</span>' . $disp_block_head) . "\n";// categories dressing - uncomment this line for heading above link
$show_this = $db->Execute("select s.products_id from " . TABLE_SPECIALS . " s where s.status= 1 limit 1");
if ($show_this->RecordCount() > 0) {
$content .= '<a class="category-links" href="' . zen_href_link(FILENAME_SPECIALS) . '">' . CATEGORIES_BOX_HEADING_SPECIALS . '</a>' . $disp_block . "\n";
}
}

CATEGORIES_BOX_HEADING_SPECIALS
to
(file_exists(DIR_WS_TEMPLATE_IMAGES . 'catimgspecials.gif')? zen_image(DIR_WS_TEMPLATE_IMAGES . 'catimgspecials.gif', '', '', '', 'title="Specials"') : CATEGORIES_BOX_HEADING_SPECIALS)
```php
    if (SHOW_CATEGORIES_BOX_SPECIALS == 'true') {
      //$content .= '<span class="catBoxHeading1">' . (file_exists(DIR_WS_TEMPLATE_IMAGES . 'cathead-specials.gif') ? zen_image(DIR_WS_TEMPLATE_IMAGES . 'cathead-specials.gif') . '</span>':'Link Heading</span>' . $disp_block_head) . "\n";// categories dressing - uncomment this line for heading above link 
      $show_this = $db->Execute("select s.products_id from " . TABLE_SPECIALS . " s where s.status= 1 limit 1");
      if ($show_this->RecordCount() > 0) {
        $content .= '<a class="category-links" href="' . zen_href_link(FILENAME_SPECIALS) . '">' . (file_exists(DIR_WS_TEMPLATE_IMAGES . 'catimgspecials.gif')? zen_image(DIR_WS_TEMPLATE_IMAGES . 'catimgspecials.gif', '', '', '', 'title="Specials"') : CATEGORIES_BOX_HEADING_SPECIALS) . '</a>' . $disp_block . "\n";
      }
    }
```Save your image as /includes/templates/your_template/images/catimgspecials.gif.

The same method will work for the other links, replacing the heading constant in the appropriate code block.
10 Sep 2008, 3:27 AM
#409
sturmgeschutz avatar

sturmgeschutz

New Zenner

Join Date:
Aug 2008
Posts:
19
Plugin Contributions:
0

Re: Categories Dressing

Hi Glenn,

I was wondering if you know how to or had a mod for an "information dressing" and "More information dressing" I would like to add images as links in these 2 sideboxes and can't find anything on that. Thank you!

Matt

10 Sep 2008, 6:05 AM
#410
gjh42 avatar

gjh42

Black Belt

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

Re: Categories Dressing

I don't have any mod for these boxes, but it should be easy enough to add images for text links, following the same instructions as given above for the Specials link. Edit
/includes/modules/sideboxes/your_template/information.php; for example, ```php
if (DEFINE_SHIPPINGINFO_STATUS <= 1) {
$information[] = '<a href="' . zen_href_link(FILENAME_SHIPPING) . '">' . BOX_INFORMATION_SHIPPING . '</a>';
}

BOX_INFORMATION_SHIPPING
to
(file_exists(DIR_WS_TEMPLATE_IMAGES . 'infoimgshipping.gif')? zen_image(DIR_WS_TEMPLATE_IMAGES . 'infoimgshipping.gif', '', '', '', 'title="Shipping"') : BOX_INFORMATION_SHIPPING) ```php
  if (DEFINE_SHIPPINGINFO_STATUS <= 1) {
    $information[] = '<a href="' . zen_href_link(FILENAME_SHIPPING) . '">' . (file_exists(DIR_WS_TEMPLATE_IMAGES . 'infoimgshipping.gif')? zen_image(DIR_WS_TEMPLATE_IMAGES . 'infoimgshipping.gif', '', '', '', 'title="Shipping"') : BOX_INFORMATION_SHIPPING) . '</a>';
  }
10 Sep 2008, 7:20 AM
#411
jvanree avatar

jvanree

Zen Follower

Join Date:
Mar 2008
Location:
Gouda, Netherlands
Posts:
211
Plugin Contributions:
0

Re: Categories Dressing

Hi Glenn,

Do you have any answer for me concerning post #406 ? (If you don't it's okay too but than I go post in another topic to find the answer but I first wanted to see if you knew)

Juliet

10 Sep 2008, 5:01 PM
#412
gjh42 avatar

gjh42

Black Belt

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

Re: Categories Dressing

I'm afraid I'm not quite clear on exactly what you want there. Tell me if I am on the right track.
On looking it over closely it appears relatively simple:

You want the top category buttons (Ad Mineraal & Skull Shop) to look different when in the Skull Shop category than when in the rest of the shop. Are there any other buttons that need to be different?

The subcategory buttons are no problem because they will only ever be seen in the Skull Shop.

You are using foreground images for categories. Background images could be handled with a per-category stylesheet, but the foreground images will require a bit of PHP added. The snippet in the thread you refer to can be used for that.
You have:```php
// categories dressing - display image if exists for category name in current language - with title tag
if (file_exists(DIR_WS_TEMPLATE . 'buttons/' . $_SESSION['language'] . '/catimg' . $current_path . '.gif')) {
$cat_name_display = zen_image(DIR_WS_TEMPLATE . 'buttons/' . $_SESSION['language'] . '/catimg' . $current_path . '.gif', '', '', '', 'title="' . $box_categories_array[$i]['name'] . '"');
}


```php
      // categories dressing - display image if exists for category name in current language - with title tag
      if ((int)$_GET[cPath] == 105) { // in Skull Shop - use different buttons
        if (file_exists(DIR_WS_TEMPLATE . 'buttons/' . $_SESSION['language'] . '/catimgsk' . $current_path . '.gif')) {
          $cat_name_display = zen_image(DIR_WS_TEMPLATE . 'buttons/' . $_SESSION['language'] . '/catimgsk' . $current_path . '.gif', '', '', '', 'title="' . $box_categories_array[$i]['name'] . '"'); 
        }
      } else {
        if (file_exists(DIR_WS_TEMPLATE . 'buttons/' . $_SESSION['language'] . '/catimg' . $current_path . '.gif')) {
          $cat_name_display = zen_image(DIR_WS_TEMPLATE . 'buttons/' . $_SESSION['language'] . '/catimg' . $current_path . '.gif', '', '', '', 'title="' . $box_categories_array[$i]['name'] . '"');
        }
      } // cPath 105 

Name all the button images you want to see when in the Skull Shop like catimgsk##.gif.

10 Sep 2008, 9:13 PM
#413
jvanree avatar

jvanree

Zen Follower

Join Date:
Mar 2008
Location:
Gouda, Netherlands
Posts:
211
Plugin Contributions:
0

Re: Categories Dressing

Glenn you are an angel, thank you so much! That is exactly what I needed!!!!!! You are really a Godsend!

16 Sep 2008, 2:50 AM
#414
sturmgeschutz avatar

sturmgeschutz

New Zenner

Join Date:
Aug 2008
Posts:
19
Plugin Contributions:
0

Re: Categories Dressing

Hi Glenn,

Your code works great! Thank you! (see post #410) I tried to replace all products and new products link as you suggest in post 408 but all i achieve is that everything under my site header is blank (does not load) would you happen to know what would cause this? Thank you

Matt

16 Sep 2008, 4:28 PM
#415
gjh42 avatar

gjh42

Black Belt

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

Re: Categories Dressing

Please post your code from that area of tpl_categories.php (in ```
[php] and [/php]

18 Sep 2008, 2:09 AM
#416
sturmgeschutz avatar

sturmgeschutz

New Zenner

Join Date:
Aug 2008
Posts:
19
Plugin Contributions:
0

Re: Categories Dressing

Hi Glenn,

Figured it out myself. It looks great now, thanks for all the help i really appreciate it.

Matt

10 Oct 2008, 10:15 PM
#417
some_name_not_taken avatar

some_name_not_taken

Zen Follower

Join Date:
Sep 2008
Posts:
106
Plugin Contributions:
0

Re: Categories Dressing

I have been trying to use your Category Dressing mod and cannot get it to function at all.

  • I've checked, rewritten, cut 'n' paste, everything I can think of with your code, played with hundreds of settings in Admin, messed with the images, changed the CSS, even considered using a SQL patch - the images in place of category names simply will not work!

I am using version 1.3.8 and would prefer to have this mod running with the Column Layout mod, and using .png images.

I figure that the problem must be an incompatibility issue or a bug but, whichever, I cannot identify the problem.

Any ideas?

10 Oct 2008, 11:49 PM
#418
some_name_not_taken avatar

some_name_not_taken

Zen Follower

Join Date:
Sep 2008
Posts:
106
Plugin Contributions:
0

Re: Categories Dressing

I should also explain what it is that I am trying to do with Category Dressing:

On the main page of my store I would like to have a gridwork of boxes, one each for each of the categories in my store and with the title of the category only displayed on mouseover.

Each of these boxes will be hyperlinked to a page displaying all the products within that category and each product will be shown on its own line, with an image and title (like product listings in eBay).

Reading through the thread on the Category Dressing contribution it looks like the problem I am experiencing, with it refusing to work, could be due to me trying to use it on something other than sideboxes. - I have the setting in Admin -> Layout Settings -> Categories - Always Show On Main Page set to 1, so currently I have a nice column and row layout but absolutely can not replace the titles with images.

11 Oct 2008, 1:16 AM
#419
some_name_not_taken avatar

some_name_not_taken

Zen Follower

Join Date:
Sep 2008
Posts:
106
Plugin Contributions:
0

Re: Categories Dressing

I have found another of your contributions, Images as Titles, which makes things allot clearer. - It now looks as though the problem lies with the Column Layout mod.

There is a SQL code injection involved with this, and two files:

includes/modules/custom_template/product_listings.php
includes/templates/custom_template/templates/tpl_modules_product_listing.php

Additionally the second file references tpl_columnar_display.php, a default Zen Cart installation file, which looks to be the file I need to modify; however, whenever I try to modify it I keep loosing the footer section of every page on my site...

11 Oct 2008, 1:35 AM
#420
kuroi avatar

kuroi

Totally Zenned

Join Date:
Apr 2006
Location:
London, UK
Posts:
10,475
Plugin Contributions:
11

Re: Categories Dressing

some name not taken:

whenever I try to modify it I keep loosing the footer section of every page on my site...This suggests that you are introducing a syntax error causing php to crash. I recommend getting the debug add-in so that you can find precise information about where the error is happening.