1: Yes, this is one of the basic functions of Categories Dressing. Name your images correctly and place them in the correct directory, and they will automatically be used. See the readme in the download for details.
2: As originally written, the code does not support multiple languages. It is a very easy fix to achieve this, however. The image files are called for in several places in the code; replace each instance of
DIR_WS_TEMPLATE_IMAGES . '
with
DIR_WS_TEMPLATE . 'buttons/' . $_SESSION['language'] . '/
and place the image files in
/includes/templates/your_template/buttons/your_language/.
3: This will require a bit more customizing, as the stylesheet can't use $_SESSION['language'].
In tpl_categories.php, this section, for example,
PHP Code:
// categories dressing - display image if exists for category name
if (file_exists(DIR_WS_TEMPLATE_IMAGES . 'catimg' . $current_path . '.gif')) {
$cat_name_display = zen_image(DIR_WS_TEMPLATE_IMAGES . 'catimg' . $current_path . '.gif');
// categories dressing - display background image if exists for category name
} elseif (file_exists(DIR_WS_TEMPLATE_IMAGES . 'catbg' . $current_path . '.gif')) {
$cat_name_display = '';
$cat_img_bg = ' catBg' . $current_path;
} else {
$cat_img_bg = '-text';//append to main classname
}
will become
PHP Code:
// categories dressing - display image if exists for category name
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');
// categories dressing - display background image if exists for category name
} elseif (file_exists(DIR_WS_TEMPLATE . 'buttons/' . $_SESSION['language'] . '/catbg' . $current_path . '.gif')) {
$cat_name_display = '';
$cat_img_bg = ' catBg' . $current_path . '-' . $_SESSION['language'];
} else {
$cat_img_bg = '-text-' . $_SESSION['language'];//append to main classname
}
using $_SESSION['language'] to add
-your_language
to the end of class tags.
In the stylesheet, replace each instance of
url(../images/
with
url(../buttons/your_language/
You will need a separate declaration for each language.
Code:
/*example for individual category as bg image*/
a.catBg25 {
background-image: url(../images/catbg25.gif);
height: 30px;
}
will become
Code:
/*example for individual category as bg image*/
a.catBg25-english {
background-image: url(../buttons/english/catbg25.gif);
height: 30px;
}
a.catBg25-french {
background-image: url(../buttons/french/catbg25.gif);
height: 30px;
}
The same modifications can be applied to other parts of the code, depending on which functions you wish to use.
Bookmarks