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)
-   -   Adding category banners (https://forum.x-cart.com/showthread.php?t=56098)

madason2k 10-20-2010 01:05 AM

Adding category banners
 
Hi,

I want to add a banner to the top of every category but aren't sure where it goes (i was hoping to just do it by CSS). Anyone got any pointers?

A banner under the "CPU's" header would be great as shown here: http://www.freshtechsolutions.co.uk/home.php?cat=70

Thanks for your time and any help is appriciated.

PhilJ 10-20-2010 01:25 AM

Re: Adding category banners
 
Your signature says 4.4.2, yet it's not out yet :)

Can't you just add banner image as category icons in category admin?

Or, for v4.4.1 (assuming light and lucid skin)

skin/common_files/customer/subcategories.tpl

Insert...

Code:

{if $cat eq "70"}<img src="{$ImagesDir}/banners/70.jpg" />{/if}

Or if you are prepared to make banners for every category...

Code:

<img src="{$ImagesDir}/banners/{$cat}.jpg" />

madason2k 10-22-2010 03:07 AM

Re: Adding category banners
 
Its not showing for some reason.

I have this in the subcategories.tpl:

<h3{if $class} class="{$class}"{/if}>{$title}</h3>
{if $cat eq "443" OR "444"}<img src="{$ImagesDir}/amd.jpg" />{/if}

PhilJ 10-22-2010 03:09 AM

Re: Adding category banners
 
Use...
Code:

{if $cat eq "443" || $cat eq "444"}

madason2k 10-25-2010 12:05 AM

Re: Adding category banners
 
still no luck :/

peddler 10-25-2010 08:46 AM

Re: Adding category banners
 
Try this:

Code:

{if $current_category.categoryid eq "443" or "444"}<img src="{$ImagesDir}/amd.jpg" />{/if}


Generally.. use lower-case boolean in smarty tpl files: and, or, ne, eq, etc. and use symbolic boolean in php files and javascript entries within tpl files: &&, ||, ==, !, etc

But mix-and-match works.. generally. :wink:

Dan.roh 10-25-2010 09:16 AM

Re: Adding category banners
 
Quote:

Originally Posted by madason2k
Hi,

I want to add a banner to the top of every category but aren't sure where it goes (i was hoping to just do it by CSS). Anyone got any pointers?

A banner under the "CPU's" header would be great as shown here: http://www.freshtechsolutions.co.uk/home.php?cat=70

Thanks for your time and any help is appriciated.



Correct me if I am mistaken? Why go through all that trouble? Just go in admin - Categories - "Choose your category" and then click on Modify category and then in your Description area put a banner there

Here is an example on my site http://www.customoid.co.uk/miscellaneous/

Snowrev 11-02-2010 08:11 AM

Re: Adding category banners
 
If you were to do this, could you display a scaled down version of the same image on every product page per manufacturer?

If so where could you apply the code to display the banner above the product description?

Where would you upload the files?

What could would you use for that?


All times are GMT -8. The time now is 05:57 AM.

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