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

Image for Category Description

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 09-19-2009, 11:55 AM
  Cyber Matrix's Avatar 
Cyber Matrix Cyber Matrix is offline
 

eXpert
  
Join Date: Dec 2006
Posts: 199
 

Default Image for Category Description

I have seen cart sites using an background image on category pages and I'm looking for a way to place a background image for each main category and have the title and text show up on top.

Does any one have any suggestions as to how to do this? I have attached an example for an idea of what I'm looking to achieve.
Attached Thumbnails
Click image for larger version

Name:	category-background.jpg
Views:	190
Size:	24.3 KB
ID:	1670  
__________________
Cyber Matrix
-------------------
X-Cart 4.1.9
Reply With Quote
  #2  
Old 09-19-2009, 04:10 PM
  cflsystems's Avatar 
cflsystems cflsystems is offline
 

Veteran
  
Join Date: Apr 2007
Posts: 14,201
 

Default Re: Image for Category Description

You can add these images as category images for each category. Then in subcategories.tpl you can set style to use as a background the image of this category
__________________
Steve Stoyanov
CFLSystems.com
Web Development
Reply With Quote
  #3  
Old 09-21-2009, 04:46 PM
  gb2world's Avatar 
gb2world gb2world is offline
 

X-Wizard
  
Join Date: May 2006
Location: Austin, TX
Posts: 1,970
 

Default Re: Image for Category Description

This thread describes something that might be similar to what you are trying to do
__________________
X-CART (4.1.9,12/4.2.2-3/4.3.1-2/4.4.1-5)-Gold
(CDSEO, Altered-Cart On Sale, BCSE Preorder Backorder, QuickOrder, X-Payments, BCSE DPM Module)
Reply With Quote
  #4  
Old 09-23-2009, 04:45 PM
  Cyber Matrix's Avatar 
Cyber Matrix Cyber Matrix is offline
 

eXpert
  
Join Date: Dec 2006
Posts: 199
 

Default Re: Image for Category Description

I wanted to post how I was able to accomplish this for anyone else wanting to do it. Once I made these changes all I had to was create a banner for each main category and upload the banner in the respected category.

I'm using CDSEO Pro on the site and I have created another template named dialog_h1.tpl to pull all the information for the categories I want to show the banner for and have an if statement not to show on the cats I do not want a banner for. You should be able to get the idea from the code below if you are not using CDSEO Pro.

In your customer/main/subcategories.tpl look for

Code:
{include file="dialog.tpl" title=$current_category.category content=$smarty.capture.dialog extra='width="100%"'}

and I replace it with

Code:
{* WCM - CDSEO Pro - Use Page Title in dialog.tpl *} {* include file="dialog_h1.tpl" title=$current_category.category content=$smarty.capture.dialog extra='width="100%"' *} {include file="dialog_h1.tpl" title=$wcmcdseoCustomTitle content=$smarty.capture.dialog extra='width="100%"'} {* / WCM - CDSEO Pro - Use Page Title in dialog.tpl *}
notice the dialog_h1.tpl is normally the dialog.tpl
which allows me to have more control over the title, you can find more information at https://www.websitecm.com/support/index.php?_m=knowledgebase&_a=viewarticle&kbarticl eid=71

this is my dialog_h1.tpl with the if statement for what cats I want the banner to show

Code:
{if $current_category.categoryid eq 218 } <div id="catheaders"> <div style="background-image:url({if $current_category.icon_url}{$current_category.icon_url}{else}{$xcart_web_dir}/image.php?id={$cat}&amp;type=C{/if}); height:140px ; background-repeat:no-repeat"> <div id="catheaderh1"> <h1 class="cats-h1">{$title}</h1></div> <div id="catheaderh2"><h2 class="cats-h2">{$current_category.description}</h2></div></div> <div class="DialogBox">{$content}</div> {else} <div> <h1>{$title}</h1>{$current_category.description}</div> <div class="DialogBox">{$content}</div> {/if}

Here is the CSS that I put in the skin1.css you can modify it to your liking
Code:
/* Category Headers Banners */ #catheader { height:100px; } #catheaderh1 { line-height:30px; margin:0; padding:25px 0 0 14px; } .cats-h1{ FONT-SIZE: 28px; color:#000000; margin:0; padding:0; font-family: Arial, Helvetica, sans-serif; } #catheaderh2{ font-weight:normal; margin:0; padding:0 0 35px 15px; width:450px; } .cats-h2{ FONT-SIZE: 17px; color:#000000; margin:0; padding:0; font-family: Arial, Helvetica, sans-serif; } /* Category Headers Banners End */

Hope this helps
__________________
Cyber Matrix
-------------------
X-Cart 4.1.9
Reply With Quote
  #5  
Old 09-23-2009, 04:57 PM
  Cyber Matrix's Avatar 
Cyber Matrix Cyber Matrix is offline
 

eXpert
  
Join Date: Dec 2006
Posts: 199
 

Default Re: Image for Category Description

Here is an example of what it looks like
Attached Thumbnails
Click image for larger version

Name:	Untitled-10.jpg
Views:	192
Size:	41.1 KB
ID:	1673  
__________________
Cyber Matrix
-------------------
X-Cart 4.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 12:16 PM.

   

 
X-Cart forums © 2001-2020