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)
-   -   Custom Layout for a Root Category Page (https://forum.x-cart.com/showthread.php?t=19834)

groovebox 02-08-2006 03:59 PM

Custom Layout for a Root Category Page
 
Hello Everyone,

I am looking to include a {if}{else} statement and create some custom layouts for various category descriptions.

I do this with some of my product pages already. I just cant get it to work with categories. Currently I am posting the statement in subcategories.tpl

Here is my customized subcategories.tpl - i have addes space on either side of my inserted statement that includes .tpl file within the {capture} statement.


Code:

{* $Id: subcategories.tpl,v 1.43.2.5 2004/12/01 15:15:49 mclap Exp $ *}
{if $active_modules.Bestsellers ne "" and $config.Modules.bestsellers_menu ne "Y"}



{include file="modules/Bestsellers/bestsellers.tpl"}
{/if}



{if $active_modules.Special_Offers}
{include file="modules/Special_Offers/customer/category_offers_short_list.tpl}
{/if}
{capture name=dialog}
{assign var="tmp" value="0"}

{if $cat eq "268" } 
  {assign var="id" value=$cat}
          {assign var="file" value=main}
        {assign var="includeRoot" value=include/cat/}
        {assign var="path" value="$includeRoot$id$file.tpl"}
        {include file=$path }
        {else}

{section name=cat_num loop=$subcategories}
{if $subcategories[cat_num].category}{assign var="tmp" value="1"}{/if}
{/section}
{if $subcategories}
{* Uncomment for Subcategories and Main Graphic {if $tmp}  [img]{if $current_category.icon_url}{$current_category.icon_url}{else}{$xcart_web_dir}/icon.php?categoryid={$cat}{/if}[/img] {/if}    *}
{foreach from=$subcategories item=subcat}
<FONT class="ItemsList">{ $subcat.category|escape }</FONT>|
{if $config.Appearance.count_products eq "Y"}
{if $subcat.product_count}{ $subcat.product_count } {$lng.lbl_products}
{elseif $subcat.subcategory_count}{ $subcat.subcategory_count } {$lng.lbl_categories|lower}
{/if}
{/if}
{/foreach}
{/if}
{if $tmp and $products ne "" }
<HR size="1" noshade>
 {/if}
 {if $products}
 {if $sort_fields}
 <DIV align="right">{include file="main/search_sort_by.tpl" sort_fields=$sort_fields selected=$search_prefilled.sort_field  direction=$search_prefilled.sort_direction url="home.php?cat=`$cat`&"}</DIV>
 {/if}
 {if $total_pages gt 2}
 { include file="customer/main/navigation.tpl" }
 {/if}
 

 {include file="customer/main/products.tpl" products=$products}
 {/if}
 {if $products eq "" and $tmp eq "0"}
 {$lng.txt_no_products_in_cat}
 {/if}

{/if}

{/capture}
{include file="dialog.tpl" title=$current_category.category content=$smarty.capture.dialog extra="width=100%"}
{if $products eq ""}
{if $f_products ne ""}



{include file="customer/main/featured.tpl"}
{/if}
{/if}
{ include file="customer/main/navigation.tpl" }


Currently when I use this code, the original product description that was created in xcart/admin is displayed and then the custom included .tpl file is displayed beneath the original. Both are captured within the dialog box.


Any help is appreciated

xcart v4.0.13 [unix]

groovebox 02-09-2006 11:41 AM

Any Ideas.... I have read some other posts, but nothing I have found clarifies or resolves this problem.

Thanks again.


All times are GMT -8. The time now is 11:55 PM.

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