-
Re: 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
-
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 Code:
// 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):
Code:
a.catBg25 {
background-image: url(../buttons/yourlanguage/catbg25.gif);
height: 30px;
}
a.catBg25:hover {
background-image: url(../buttons/yourlanguage/catbg25hover.gif);
}
-
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
-
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.
-
Re: Categories Dressing
:smile::smile::smile::smile:
Glenn, your a genious!
thanks a lot!!! it works like charm...
:clap:
-
Re: Categories Dressing
Hi Glenn,
Related to this thread http://www.zen-cart.com/forum/showth...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?...ndex&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
-
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/
-
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 Code:
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";
}
}
Change the
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 Code:
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.
-
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
-
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 Code:
if (DEFINE_SHIPPINGINFO_STATUS <= 1) {
$information[] = '<a href="' . zen_href_link(FILENAME_SHIPPING) . '">' . BOX_INFORMATION_SHIPPING . '</a>';
}
by changing
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 Code:
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>';
}