X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Changing design (https://forum.x-cart.com/forumdisplay.php?f=51)
-   -   Add Icon to Category menu list (https://forum.x-cart.com/showthread.php?t=63580)

scalemar 05-09-2012 11:06 AM

Add Icon to Category menu list
 
Hello:

I want to add an Icon to the "category name" in the "category menu list" and include the 'ALT TEXT',

I did already this addition, WITH the fly-out menu activated in:
skin/common_files/modules/Flyout_Menus/Icons/fancy_subcategories.tpl

Now I want to do the same but WITHOUT the fly-out menu activated (It's so heavy to load).
Please let me know, how I can do this mod.
Thank you

MC
X-cart V4.4.5

http://www.digitalscalesusa.com/flyout_menus.png

cflsystems 05-09-2012 11:11 AM

Re: Add Icon to Category menu list
 
The category icon is there but you need to modify the categories template to show it. You can take a look at how the code is in the flyout menus templates as an example of how to call the image there

scalemar 05-09-2012 12:11 PM

Re: Add Icon to Category menu list
 
Hi Steve:
1. I did the modification to the Flyout menu code as (underline is my Alt-text):
fancy_subcategories.tpl
{if $config.Flyout_Menus.icons_icons_in_categories gte $level+1 and $c.is_icon}
<img src="{$c.thumb_url|amp}" alt="{$c.category|escape}" width="{$c.thumb_x}" height="{$c.thumb_y}" />
{/if}

2. Without flyout menu,(categories.tpl) the code is:
{foreach from=$categories_menu_list item=c name=categories}
<li{interline name=categories}><a href="home.php?cat={$c.categoryid}" title="{$c.category|escape}">{$c.category|amp} </a></li>
{/foreach}

How I add the alt-text in accordance with the category name to the the icons?

Thank you

Moses

cflsystems 05-09-2012 12:21 PM

Re: Add Icon to Category menu list
 
<a> tag doesn't have alt attribute, it has title attribute. Alt doesn't make sense for <a> tag as you have a text for the link, the alt attribute is for like image to show if the image cannot be shown for any reason
You can just copy the <img....> line to the code without flyout just before the <a> tag


All times are GMT -8. The time now is 08:33 PM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.