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
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
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?
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 :Code:define('CATEGORIES_BOX_HEADING_SPECIALS','Specials ...');If the zen_image() function doesn't give the right results here, tryCode:define('CATEGORIES_BOX_HEADING_SPECIALS',zen_image(DIR_WS_TEMPLATE . 'buttons/' . $_SESSION['language'] . '/catimgspecials.gif', 'Specials') );
Save the image asCode:define('CATEGORIES_BOX_HEADING_SPECIALS','<img src="' . DIR_WS_TEMPLATE . 'buttons/' . $_SESSION['language'] . '/catimgspecials.gif" alt="Specials" />');
/includes/templates/your_template/buttons/english/catimgspecials.gif
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 thisto thisPHP Code:
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";
}
}
Not tested yet, but this should use the image atPHP Code:
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
}
}
/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.
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).This will give a classname of .category-links for images and .category-links-text for text.PHP Code:
//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
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.
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
noneI will test the code and post a working version later.Code:/*different bullet for links if desired*/ #categories li a.category-links { list-style: none; }
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.
You are using BetterCategories, not Categories Dressing, so you need to ask in that mod's support thread.
Thanks Glenn - that has worked perfectly.
Bookmarks