CS-Cartshopping cartsoftware · Ecommerce solution
Go Back   CS-Cart Community Forums > Version 1.x > v1.x Configuration
Reply
 
Thread Tools Display Modes
Old 12-17-2008, 02:26 AM   #1
Triplets
Senior Member
CS Guru
 
Triplets's Avatar
 
Join Date: Sep 2008
Location: Orlando, FL
Posts: 413
Default Use Different Template Mod

I am using the following mod to load different template files based on what category is chosen. I thought it might be beneficial to others:

In content.tpl

Code:
{if $content == "categories"  || $content == "category_products"}
	{if $category_data.category_id == "26" || $category_data.category_id == "20" || $category_data.category_id == "36" || $category_data.category_id == "27" || $category_data.category_id == "37" || $category_data.category_id == "43" || $category_data.category_id == "42" || $category_data.category_id == "7"}
    {include file="categories_pages/categories2.tpl"}
    {else}
    {include file="categories_pages/categories.tpl"}
    {/if}
This way you can have different looks for different categories (e.g. grid or list layout).

Last edited by Triplets : 12-17-2008 at 02:32 AM.
Triplets is offline   Reply With Quote
Old 12-17-2008, 02:28 AM   #2
Triplets
Senior Member
CS Guru
 
Triplets's Avatar
 
Join Date: Sep 2008
Location: Orlando, FL
Posts: 413
Default

You can do the same thing to load a different template for a product:

In content.tpl

Code:
{elseif $content == "product_details"}

    {if $product.product_code=="RTN"}
    {include file="products_pages/product_details_labels.tpl"}

    {elseif $product.product_code=="ANN"}
    {include file="products_pages/product_details2_hidden.tpl"}

    
     {elseif $product.product_code=="ANN45"}
    {include file="products_pages/product_details_sonanddaughter.tpl"}

   {elseif  $product.main_category == "26" || $product.main_category == "20" || $product.main_category == "36" || $product.main_category == "27" || $product.main_category == "37" || $product.main_category == "43" || $product.main_category == "42" || $product.main_category == "7"}
    {include file="products_pages/product_details2.tpl"} 
        
    {else}
    {include file="products_pages/product_details.tpl"}
    {/if}
Triplets is offline   Reply With Quote
Old 12-17-2008, 04:40 AM   #3
MikeFold
Senior Member
CS Guru
 
MikeFold's Avatar
 
Join Date: Nov 2006
Location: Cleveland
Posts: 1,033
Default

Thanks triplets...
I was close, but missed the mark
this did the trick
I appreciate it
__________________
Seamlessly Upgraded to 1.3.5sp4 from 1.3.4sp3
Live: Playboy Collectors Gallery
(Adult)


LOOKING FOR A FEW COPIES OF THE NEW LITHUANIA PLAYBOY ISSUES...AND COLOMBIA ISSUES.....
FEEL FREE TO Private Message Me....THANKS


Slightly Modded Default Red | Zardos Lightbox | Sitemap | Multicards Payment Mod |
Cart & Checkout Pages Modified |
MikeFold is offline   Reply With Quote
Reply


Thread Tools
Display Modes

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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Template Editor doddles v1.x Configuration 2 11-29-2007 07:11 PM
debugging template jayzee General Questions 3 11-14-2007 04:41 PM
if/else template help bpaulette General Questions 2 05-22-2007 09:50 PM
Template Help JosiahW v1.x Configuration 1 12-16-2006 12:32 AM