My goal for today is to replace the standard text links on the categories-tabs menu with image links. Merlin's code HERE isn't ideal, as I need the category names to appear properly. Later in the same thread, GJH posts a method to do it, but only with the main tpl_categories file. I need the same thing, but with the categories-tabs menu.
My current site is up at http://test.headsonic.com. Below the logo.gif is the navcattabs menu, where there are currently two links (my only two categories, Headphones and Microphones). In order to style these like what I want (see http://files.headsonic.com/files/1/finalwant.png for an example), I believe I need to hardwire the images into PHP, like in Glenn's solution.
However, the PHP for the categories-tabs menu (seen in includes/templates/YOUR_TEMPLATE/templates) is pretty much indecipherable to me:
PHP Code:
<?php
include(DIR_WS_MODULES . zen_get_module_directory(FILENAME_CATEGORIES_TABS));
?>
<?php if (CATEGORIES_TABS_STATUS == '1' && sizeof($links_list) >= 1) { ?>
<div id="navCatTabsWrapper">
<div id="navCatTabs">
<ul>
<?php for ($i=0, $n=sizeof($links_list); $i<$n; $i++) { ?>
<li><?php echo $links_list[$i];?></li>
<?php } ?>
</ul>
</div>
</div>
<?php } ?>
The modules/categories_tabs.php is as such:
PHP Code:
<?php
if (!defined('IS_ADMIN_FLAG')) {
die('Illegal Access');
}
$order_by = " order by c.sort_order, cd.categories_name ";
$categories_tab_query = "select c.categories_id, cd.categories_name from " .
TABLE_CATEGORIES . " c, " . TABLE_CATEGORIES_DESCRIPTION . " cd
where c.categories_id=cd.categories_id and c.parent_id= '0' and cd.language_id='" . (int)$_SESSION['languages_id'] . "' and c.categories_status='1'" .
$order_by;
$categories_tab = $db->Execute($categories_tab_query);
$links_list = array();
while (!$categories_tab->EOF) {
// currently selected category
if ((int)$cPath == $categories_tab->fields['categories_id']) {
$new_style = 'category-top';
$categories_tab_current = '<span class="category-subs-selected">' . $categories_tab->fields['categories_name'] . '</span>';
} else {
$new_style = 'category-top';
$categories_tab_current = $categories_tab->fields['categories_name'];
}
// create link to top level category
$links_list[] = '<a class="' . $new_style . '" href="' . zen_href_link(FILENAME_DEFAULT, 'cPath=' . (int)$categories_tab->fields['categories_id']) . '">' . $categories_tab_current . '</a> ';
$categories_tab->MoveNext();
}
?>
Bookmarks