Originally Posted by
CustomBooks
What file contains:
<div class="betterCategories">
<a class="category-top" href="http://www.mydomain.com/index.php?main_page=index&cPath=32">
<img src="includes/templates/mytemplate/images/bc_cat_pointer_right.gif" alt="" width="19" height="13" />mycategory</a></div>
I want to fill in the alt tag. Is there a way use the image name as a default for this alt tag?
I tried using Developers Toolkit but cannot locate the file that creates the empty alt tag for this image...
I know this is an old thread, but here's my solution for a "valid" ALT TAG in this situation:
TWO ACTIONS NEEDED:
1. CREATE THIS PHP FILE IN A PLAIN TEXT EDITOR
better_categories_pointer_defines.php
PHP Code:
<?php
/**
* @package languageDefines
* @copyright Copyright 2003-2006 Zen Cart Development Team
* @copyright Portions Copyright 2003 osCommerce
* @license http://www.zen-cart.com/license/2_0.txt GNU Public License V2.0
* @version $Id: better_categories_pointer_defines.php v1.x $
*/
// this is used to display some ALT TEXT for the pointers in the "better categories sidebox"
define('MAINCAT_POINTER_ALT_TEXT', 'Main Category Pointer');
define('SUBCAT_POINTER_ALT_TEXT', 'Sub Category Pointer');
define('POINTER_ALT_TEXT', 'Category Pointer');
?>
LOAD THE PHP FILE TO:
includes/languages/english/YOUR_TEMPLATE/extra_definitions/
2. MAKE EDITS TO THE CATEGORIES SIDEBOX TEMPLATE FILE
(This may just be called "categories.php" in your template's SIDEBOX folder - or it may be in another sidebox folder. In any event, it is the TPL file for the better_categories sidebox)...
AROUND LINES 130 onwards... add the define constants (IN RED)
Code:
//picking the appropriate pointer image:
switch ($categoryType) {
case "down":
$pointer = zen_image(DIR_WS_TEMPLATE_IMAGES . 'bc_cat_pointer_down.gif', MAINCAT_POINTER_ALT_TEXT);
break;
case "right":
$pointer = zen_image(DIR_WS_TEMPLATE_IMAGES . 'bc_cat_pointer_right.gif', SUBCAT_POINTER_ALT_TEXT);
break;
default:
$pointer = zen_image(DIR_WS_TEMPLATE_IMAGES . 'bc_cat_no_sub.gif', POINTER_ALT_TEXT);
Bookmarks