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 icons netx to category names (https://forum.x-cart.com/showthread.php?t=25919)

zebu 10-18-2006 02:57 PM

add icons netx to category names
 
I am not using fancy categories module.

I would like to add a "button" type image next to each listing in my categories menu - just to Pretty it up a little.

Is this possible and where do I start?

balinor 10-18-2006 05:29 PM

Re: add icons netx to category names
 
customer/categories.tpl

zebu 10-18-2006 07:10 PM

Re: add icons next to category names
 
Thanks so something like
<img src ="Button " height="10" width="10" img src="path to my file" cat={$categories[cat_num].categoryid}

Not sure where to plonk it in the code?

balinor 10-19-2006 02:27 AM

Re: add icons netx to category names
 
You don't need to put anything about the cat in there, just make it a simple image tag:

<img src="{$ImagesDir}/image.jpg" width="10" height="10">

Put it right before this:

<FONT class="CategoriesList">

zebu 10-19-2006 03:58 AM

Re: add icons netx to category names
 
This is great I'm learning very quickly. :)

The image sits real close to the category name. How do I put a space between the button image and the category text?

I appreciate your time.

Zane

balinor 10-19-2006 03:59 AM

Re: add icons netx to category names
 
add a padding value to it:

<img src="{$ImagesDir}/image.jpg" width="10" height="10" style="padding-right: 10px;">

zebu 10-19-2006 04:38 AM

Re: add icons netx to category names
 
Thanks. It doesnt seem to have any effect, this is what I have.

<img src="{$ImagesDir}/menu_ball.gif" width="16" height="16"
style="padding-right: 40px;">

??

ranger82nd 10-19-2006 05:11 AM

Re: add icons netx to category names
 
What if I wanted a different icon for each category?

balinor 10-19-2006 07:46 AM

Re: add icons netx to category names
 
That is an entirely different bit of code I'm afraid :(

ranger82nd 10-19-2006 10:27 AM

Re: add icons netx to category names
 
A little clue?
Code:

{if} {$category=xxxxx} <img src=xxxx> {else}
Would it be something along these lines?

zebu 10-19-2006 01:36 PM

Re: add icons netx to category names
 
Guys,

Any clues on why the padding doesnt work? I belive I have teh syntax ok, and have played around on padding size, but it doesnt seem to add any padding?

Thanks - this place is so helpful!

balinor 10-19-2006 04:10 PM

Re: add icons netx to category names
 
No idea why padding isn't working...here's another trick...add some spacing to the image itself :)

ranger, sorry, that bit of code would be a bit more complicated than just an {if} statement, as it is a loop.

eaglemobiles 12-17-2006 02:40 PM

Re: add icons netx to category names
 
Quote:

Originally Posted by ranger82nd
What if I wanted a different icon for each category?


use this code worked 100% for me.


<td align="right">
{if $categories[cat_num].categoryid == your cat no here}
<img src="{$ImagesDir}/your_image.gif" width="20" height="20">
{/if}

Wallace 01-16-2007 02:32 AM

Re: add icons netx to category names
 
Where exactly would I paste that bit of code? Is it possible to post the whole solution in this forum? I hope it is, need it badly...

Wallace 01-17-2007 06:28 AM

Re: add icons netx to category names
 
But wait a minute... isn't it possible to configure this from admin without having to put our hands in the dirt (code)? It stands in the manual that it's possible to assign icons to categories. I suppose I can do it like so:

http://www.robdiamond.net/category/alice_wonders_buckles/

I have done it and the image shows on the top as I edit the category. I saved it and it was uploaded, because I see it from another machine. But we can only see the category icon in that particular "edit category" dialog, not anywhere
else on the site.

Sent a support ticket yesterday and still haven't got a reply. Is it a bug or am I missing something here?

Cheers,
Wallace

balinor 01-17-2007 06:31 AM

Re: add icons netx to category names
 
It isn't a bug, but a 'design flaw'. The only place a category icon shows up by default is if it is a root category with sub-categories :(

terje@hyttevakt.no 11-14-2007 12:43 PM

Re: add icons next to category names
 
To display your icon in the category meny u have to copy or raplace the categoriy.tpl with this:


{* $Id: categories.tpl,v 1.26 2005/11/17 06:55:37 max Exp $ *}
{capture name=menu}
{if $active_modules.Fancy_Categories ne ""}
{include file="modules/Fancy_Categories/categories.tpl"}
{assign var="fc_cellpadding" value="0"}
{else}
{if $config.General.root_categories eq "Y"}
{foreach from=$categories item=c}

<font class="CategoriesList"><a href="home.php?cat={$c.categoryid}" class="VertMenuItems">

{****************************Add to activate icon*}

<img src="{if $c.icon_url}{$c.icon_url}{else}{$xcart_web_dir}/image.php?id={$cat}&amp;type=C{/if}" alt="" />

{*end of change************************************}

{$c.category}
</a></font>

<font class="CategoriesList"><a href="home.php?cat={$c.categoryid}" class="VertMenuItems">{$c.category}</a></font>
<br />
{/foreach}
{else} {foreach from=$subcategories item=c key=catid}
<font class="CategoriesList"><a href="home.php?cat={$catid}" class="VertMenuItems">{$c.category}</a></font><br />
{/foreach}
{/if}
{/if}
{/capture}
{ include file="menu.tpl" dingbats="dingbats_categorie.gif" menu_title=$lng.lbl_categories menu_content=$smarty.capture.menu cellpadding=$fc_cellpadding}


You also have to save your icon in small format or insert limit for widt & height in the text above.

Running 4.1.8

JMC 04-30-2009 03:51 AM

Re: add icons netx to category names
 
Hi Zebu

May I ask how you managed to set an image for each seperate category as you have done on your site.

I am not a coder, so please could you show me the step by step process to add, change things within my site files.

I feel confident enough to work through my tpl files etc, so long as I have the code and placement location.

May I also ask you how you placed your links within the top bar instead of having them show up at the top of the header bar.

I am using the same default x-cart template as you have on your site.

Thanks for any help and advice you can give me.

Regards

John

JMC 05-07-2009 11:41 AM

Re: add icons netx to category names
 
Just bringing this up to the front again.

Anyone able to offer advice here on my questions above.

Regards

John


All times are GMT -8. The time now is 05:29 PM.

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