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

Alter subcategories_t.tpl to remove categories from homepage
 
Reply
   X-Cart forums > X-Cart 4 > Changing design
 
Thread Tools Search this Thread
  #1  
Old 01-10-2018, 02:34 AM
 
Paulw Paulw is offline
 

Senior Member
  
Join Date: Jul 2004
Location: United Kingdon (Manchester)
Posts: 134
 

Default 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
__________________
X-Cart Gold V 4.4.1
Reply With Quote
  #2  
Old 01-10-2018, 05:40 AM
  cflsystems's Avatar 
cflsystems cflsystems is offline
 

Veteran
  
Join Date: Apr 2007
Posts: 12,988
 

Default 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
__________________
Steve Stoyanov
CFLSystems.com
Web Development
Reply With Quote

The following user thanks cflsystems for this useful post:
Paulw (01-10-2018)
  #3  
Old 01-10-2018, 05:48 AM
 
Paulw Paulw is offline
 

Senior Member
  
Join Date: Jul 2004
Location: United Kingdon (Manchester)
Posts: 134
 

Default 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
__________________
X-Cart Gold V 4.4.1
Reply With Quote
  #4  
Old 01-10-2018, 05:51 AM
  cflsystems's Avatar 
cflsystems cflsystems is offline
 

Veteran
  
Join Date: Apr 2007
Posts: 12,988
 

Default 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
__________________
Steve Stoyanov
CFLSystems.com
Web Development
Reply With Quote
  #5  
Old 01-11-2018, 12:50 AM
 
Paulw Paulw is offline
 

Senior Member
  
Join Date: Jul 2004
Location: United Kingdon (Manchester)
Posts: 134
 

Default 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!
__________________
X-Cart Gold V 4.4.1
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Changing design


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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:02 AM.

   

 
X-Cart forums © 2001-2018