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)
-   -   Alter subcategories_t.tpl to remove categories from homepage (https://forum.x-cart.com/showthread.php?t=75904)

Paulw 01-10-2018 02:34 AM

Alter subcategories_t.tpl to remove categories from homepage
 
{*
$Id: subcategories_t.tpl,v 1.2 2010/06/08 10:17:47 igoryan Exp $
vim: set ts=2 sw=2 sts=2 et:
*}
{list2matrix assign="items_matrix" assign_width="cell_width" list=$categories row_length=3}
{if $items_matrix}
<div class="subcategories_t">
{foreach from=$items_matrix item=row name=items_matrix}
{assign var="additional_class" value=""}
{if $smarty.foreach.items_matrix.first}
{assign var="additional_class" value="first-row"}
{elseif $smarty.foreach.items_matrix.last}
{assign var="additional_class" value="last-row"}
{/if}
{foreach from=$row item=subcategory name=items}
<div {interline name=items additional_class=$additional_class|cat:" item"}>
{if $cat gt 0}
<a class="item-title" href="home.php?cat={$subcategory.categoryid}">{$su bcategory.category|escape}</a>{if $config.Appearance.count_products eq "Y"} <b>({*$lng.lbl_N_products|substitute:products:$sub category.product_count*}{$subcategory.product_coun t})</b>{/if}<br />
{/if}
{if $subcategory.is_icon}
<a class="image" style="width: {$subcategory.image_x}px;" href="home.php?cat={$subcategory.categoryid}"><img src="{$subcategory.icon_url|amp}" alt="{$subcategory.category|escape}" width="{$subcategory.image_x}" height="{$subcategory.image_y}" /><span class="tr"></span><span class="tl"></span><span class="rb"></span><span class="bl"></span></a>
{else}
<img src="{$ImagesDir}/spacer.gif" alt="" width="1" height="{$subcat_img_height}" />
{/if}
<div class="details">
{if $cat eq 0}
<a class="item-title" href="home.php?cat={$subcategory.categoryid}">{$su bcategory.category|escape}</a><br />
{if $subcategory.childs ne ""}
<ul>
{foreach from=$subcategory.childs item=v}
<li><a href="home.php?cat={$v.categoryid}">{$v.category}< /a>{if $config.Appearance.count_products eq "Y"} <b>({$v.product_count})</b>{/if}</li>
{/foreach}
</ul>
{/if}
{elseif $subcategory.short_descr ne ""}
{$subcategory.short_descr}
{/if}
</div>
</div>
{/foreach}
<div class="clearing{if !$smarty.foreach.items_matrix.last} separator-h{/if}"></div>
{/foreach}
<div class="separator-v i1"></div>
<div class="separator-v i2"></div>
</div>
<div class="clearing"></div>
{/if}

Hoping someone will be able to help. I have recently been dropping in google for my main keywords and think that one issue is due to too many links from my homepage. I'm now looking to remove all category links shown on the homepage as I have the top navigation anyway. Does anyone know how I would alter the template to have the desired effect?

Many thanks
Paul

X-cart 4.4.1

cflsystems 01-10-2018 05:40 AM

Re: Alter subcategories_t.tpl to remove categories from homepage
 
This template is used for categories pages only. I think stock cart does not include categories on home page. If you have them then it is something custom for your site.

Look in customer/main/welcome.tpl under your skin directory - this is the template that loads for home page

Paulw 01-10-2018 05:48 AM

Re: Alter subcategories_t.tpl to remove categories from homepage
 
{*
$Id: welcome.tpl,v 1.1.2.2 2010/08/09 06:39:52 aim Exp $
vim: set ts=2 sw=2 sts=2 et:
*}
{*
{if $display_greet_visitor_name}

<h1>{$lng.lbl_welcome_back|substitute:"name":$disp lay_greet_visitor_name} </h1>

{elseif $lng.lbl_site_title}

<h1>{$lng.lbl_welcome_to|substitute:"company":$lng .lbl_site_title|amp}</h1>

{else}

<h1>{$lng.lbl_welcome_to|substitute:"company":$con fig.Company.company_name|amp}</h1>

{/if}
*}

{if $categories}
{include file="customer/main/subcategories_t.tpl"}
{/if}

{*
{if $active_modules.Bestsellers and $config.Bestsellers.bestsellers_menu ne "Y"}
{include file="modules/Bestsellers/bestsellers.tpl"}<br />
{/if}
*}

{include file="customer/main/featured.tpl"}
{* WCM - xCMS *}
{if $active_modules.WCM_xCMS}
{include file="modules/xcms/xcms_customer_welcome.tpl"}
{/if}
{* / WCM - xCMS *}

Thanks Steve,

I've already looked in there as attached above but can't find any reference to it. The reason I post a copy of the templates_t file is because if I comment out the file or change it's name, the categories don't show on home page, but also don't show on category page?

Thanks
Paul

cflsystems 01-10-2018 05:51 AM

Re: Alter subcategories_t.tpl to remove categories from homepage
 
It's right there in front of you

Code:

{if $categories}
 {include file="customer/main/subcategories_t.tpl"}
 {/if}


Either delete or comment out this if statement

Paulw 01-11-2018 12:50 AM

Re: Alter subcategories_t.tpl to remove categories from homepage
 
Quote:

Originally Posted by cflsystems
It's right there in front of you

Code:

{if $categories}
 {include file="customer/main/subcategories_t.tpl"}
 {/if}


Either delete or comment out this if statement


Wow, thanks Steve, now I feel like a fool!


All times are GMT -8. The time now is 06:00 PM.

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