Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls
 

Help with Image in Category Menu

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 04-14-2008, 03:05 PM
 
artisan artisan is offline
 

Newbie
  
Join Date: Apr 2005
Posts: 6
 

Default Help with Image in Category Menu

Hi,

I had no luck searching for this, but can anyone tell me how to add the category image in the Category Menu?

thanks for your help in advance


x-cart version 4.1.9
__________________
Artisan
X-Cart V4.4.2
Reply With Quote
  #2  
Old 04-14-2008, 08:01 PM
  kube's Avatar 
kube kube is offline
 

X-Adept
  
Join Date: Sep 2005
Location: London: a small place East of Wales
Posts: 529
 

Default Re: Help with Image in Category Menu

hi Artisan,

If you mean category icons, here's one way although resizing maybe an issue if the icons are intended to be much larger in the header section of the main content (and remember to take care of default_icon.gif)...

in skin1/customer/categories.tpl locate something like the code below and {* comment *} it out...

Code:
{foreach from=$categories item=c} <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}

and undeneath it add this...

Code:
{foreach from=$categories item=c} <div class="CategoriesListAndIcons"><img src="{$c.icon_url}" alt="" /><a href="home.php?cat={$c.categoryid}" class="VertMenuItems">{$c.category}</a></div> {/foreach} {else} {foreach from=$subcategories item=c key=catid} <div class="CategoriesListAndIcons"><img src="{$c.icon_url}" alt="" /><a href="home.php?cat={$catid}" class="VertMenuItems">{$c.category}</a></div> {/foreach}

Then add to skin1/skin1.css...

Code:
.CategoriesListAndIcons { FONT-SIZE: 12px; /* default x-cart font-size may want to change this to em */ padding: 3px 0; /* Some spacing for top and bottom of each link */ display:block; /* Using display block so that no extra <br />s are needed */ } .CategoriesListAndIcons IMG { vertical-align:middle; /* puts the image middle of the box model */ padding-right: 4px; /* padding for the right of the icon */ padding-bottom: 2px; /* probably a better way but some browsers do not align middle properly */ height:20px; /* change this for the set height of the icons */ width:20px; /* change this for the set width of the icons */ }

Hope this helps. If I got your question horribly wrong, which I suspect, no worries I'm working on something like this at the moment as well ;D
__________________
Doms
kube v4.1.9
Reply With Quote
  #3  
Old 04-14-2008, 08:14 PM
  kube's Avatar 
kube kube is offline
 

X-Adept
  
Join Date: Sep 2005
Location: London: a small place East of Wales
Posts: 529
 

Default Re: Help with Image in Category Menu

And if it's the category header image you're after, make a back up of dingbats_categorie.gif and rename it or something. Then upload your own image with the same filename.

Or similarly open up skin1/customer/categories.tpl and locate (should be near enough the last line)...

{ include file="menu.tpl" dingbats="dingbats_categorie.gif" menu_title=$lng.lbl_categories menu_content=$smarty.capture.menu cellpadding=$fc_cellpadding}

Upload your image to your /skin1/images/ folder and change the dingbats located in the code above, to dingbats="whatever-filename.jpg"

Hope this helps.
__________________
Doms
kube v4.1.9
Reply With Quote
  #4  
Old 05-12-2008, 01:52 AM
 
mishka mishka is offline
 

Newbie
  
Join Date: Feb 2008
Posts: 4
 

Default Re: Help with Image in Category Menu

Wasn't sure whether to start a new topic, or add my question in here.

I am new to x-cart, and have learnt a lot from these forums. I came in here tonight specifically looking for this type of information, only i am hoping to take it a step further.

I'd like to do away with the categories header altogether, and have buttons down the side for all the different categories i'm offering:
so right now i have the sideboxes and the first one says categories, but i want to do away with that and just have my buttons down the side of the page instead, like,
soap
lotions
body butters
soy candles
etc
etc
etc.

Can you tell me what code would need to be added to make this happen?
Also, specifically which files to change too.

In the meantime i''ll go play with this and see if i can manage it, without breaking my site.

Thankyou in Advance
__________________
X-Cart Gold v4.1.9
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 09:27 AM.

   

 
X-Cart forums © 2001-2020