-
Re: Categories Dressing
Nilsen -
The catimg1.gif and catbg1.gif are not able to be used at the same time. If a catimg#.gif file is found for the category, the code will not look for a catbg#.gif file, nor use it if it exists. Delete catimg1.gif and see if catbg1.gif and catbg1hover.gif show up.
I have described the modifications for bilingual images above.
Juliet -
I have to get to sleep now... I'll look at your code when I get back to the computer in a day or so.
-
Re: Categories Dressing
-
Re: Categories Dressing
For bilingual background images, the language-specific stylesheets would be the way to go, instead of altering the PHP code. The class/id tags would stay the same, but the image files associated with them would change based on the language.
-
Re: Categories Dressing
Thinking more about the bg images - the method above will work correctly, as long as there is one image named according to the pattern (/your_template/images/catbg#.gif). This can be for any of the languages; the other language(s) can call for an image in the language stylesheet with any name desired (for example /your_template/images/catbg#french.gif), as these will not be checked for in the PHP code.
This does mean that if an alternate image file is missing, the code will not know it and will still be calling for it. The PHP code method is more robust and will check for the current language bg image.
-
Re: Categories Dressing
Juliet -
I can't troubleshoot your code when I can't see what wasn't working for you. Can you put it back the way you had it and post the relevant part of the file? (10 lines or so in the area should be enough.)
-
Re: Categories Dressing
Glenn,
You are an absolute angel, you are so kind to help me!!!
PHP Code:
// skip if this is for the document box (==3)
} else {
// categories dressing - add divider above specified cats
if(in_array($current_path, explode(",",'3,22,21_56'))) { //replace numbers with your cat ids separated by commas
$content .= '<hr class="catBoxDivider" />' . "\n";
}
// 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 - add (divider and) heading above a cat
switch ($current_path) {
case '23': //replace number with your desired cPath
//$content .= '<hr class="catBoxDivider" />' . "\n"; // to add divider uncomment this line
$content .= '<span class="catBoxHeading1">' . (file_exists(DIR_WS_TEMPLATE_IMAGES . 'cathead' . $current_path . '.gif') ? zen_image(DIR_WS_TEMPLATE_IMAGES . 'cathead' . $current_path . '.gif') . '</span>':'Heading 1</span>' . $disp_block_head) . "\n";
break;
}
-
Re: Categories Dressing
I almost understand what you say about working it trough the stylesheet, but still two questions about it.
Would I have to name every button in the stylesheet seperatly? So I mean /your_template/images/catbg1.gif,/your_template/images/catbg2.gif,/your_template/images/catbg3.gif etcetra.
And do I keep the php in this case or would I throw it out?
-
1 Attachment(s)
Re: Categories Dressing
Hi Glenn,
thanks for your help. I have taken the catimg1 out, but now I don't see any image at all, only a gray rectangle (see pic) also by rollover. I also don't see the text of the cat.
How can I fix this?
thanks a lot!!!
nils
-
Re: Categories Dressing
Juliet - it looks like you have added the whole lines I posted to your tpl_categories.php at a different location in the file instead of replacing the original lines with the modified ones.
Your file has this:
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 - with title tag
if (file_exists(DIR_WS_TEMPLATE_IMAGES . 'catimg' . $current_path . '.gif')) {
$cat_name_display = zen_image(DIR_WS_TEMPLATE_IMAGES . 'catimg' . $current_path . '.gif', '', '', '', 'title="' . $box_categories_array[$i]['name'] . '"');
It should be changed to this:
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'] . '"');
-
Re: Categories Dressing
The background image comments were for nilsen. They don't apply to what you are doing, Juliet.
Nilsen - can you post a link to your site? That would help me figure out why you are not getting good results. It's hard to troubleshoot something you can't really see.