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

Image as Category Name

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 03-14-2011, 11:16 AM
 
digiemp digiemp is offline
 

Senior Member
  
Join Date: Aug 2007
Posts: 192
 

Default Image as Category Name

Hello,

Is it possible to add unique images in place of specific category names? I have the Category Heading mod but it can add an image before the category, not as a category. I can make the image link to a static page or even an already existing category, but in order to link it to itself it seems that I'd have to have the image display and the regular category name display, and this isn't really what I want as there would be two links right next to each other that point to the same place.

Is there a simple way to hide a category from displaying in the Category section? Is this the best solution?

By hiding the category on the admin side I can use the Heading mod to place an image link to the hidden category that would display in the Category section.

Is there another way to do this?

Thanks,
__________________
version 4.4.2
Reply With Quote
  #2  
Old 03-16-2011, 06:32 AM
 
digiemp digiemp is offline
 

Senior Member
  
Join Date: Aug 2007
Posts: 192
 

Default Re: Image as Category Name

What I'd like to do is be able to add a field to the Category Details page in the admin section that would allow me to input an image file path (or to upload an image). If the filed is blank then the normal text style would be used but if a proper image path is entered then it would display the image instead of text.
__________________
version 4.4.2
Reply With Quote
  #3  
Old 03-16-2011, 06:38 AM
 
balinor balinor is offline
 

Veteran
  
Join Date: Oct 2003
Location: Connecticut, USA
Posts: 30,253
 

Default Re: Image as Category Name

Easiest way to do this - as I have done in the past - is to simply name the images according to the category id - then they will automatically be called and you don't have to worry about adding a path for every single one. You'd just use this in place of the category title:

<img src="{$ImagesDir}/cat-images/{$current_category.categoryid}.jpg" alt="{$current_category.category|escape}" />

Then just create a folder called cat-images in the common_files/images folder called 'cat-images' and upload your jpg images (or png if you prefer) there.

Note that this will not be as good from an SEO perspective as real text with an h1 tag around it though.
__________________
Padraic Ryan
Ryan Design Studio
Professional E-Commerce Development
Reply With Quote
  #4  
Old 03-16-2011, 06:48 AM
 
digiemp digiemp is offline
 

Senior Member
  
Join Date: Aug 2007
Posts: 192
 

Default Re: Image as Category Name

Thanks!

So if I have an image I want as the title I just input the code above into the Title field on the Category Details page? (after I've added the images to the correct directory of course)
And if I want normal text then I simply input a text title as normal?
__________________
version 4.4.2
Reply With Quote
  #5  
Old 03-16-2011, 06:54 AM
 
balinor balinor is offline
 

Veteran
  
Join Date: Oct 2003
Location: Connecticut, USA
Posts: 30,253
 

Default Re: Image as Category Name

No, this is a global solution - you'd need to add this code into the template in place of the code for the title - you can't add this to the title field in the admin, that doesn't accept html.
__________________
Padraic Ryan
Ryan Design Studio
Professional E-Commerce Development
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 11:34 PM.

   

 
X-Cart forums © 2001-2020