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

Categories in Columns on Front Page v4.x

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions
 
Thread Tools Search this Thread
  #1  
Old 07-11-2007, 08:16 AM
 
PhilJ PhilJ is offline
 

X-Guru
  
Join Date: Nov 2002
Posts: 4,094
 

Default Categories in Columns on Front Page v4.x

1) Create a new file according to your version, either...

cats_in_cols_v40x.tpl

or...

cats_in_cols_v41x.tpl

2) Add the code below according to your version...

Code for v4.0.x

Code:
{* -------------------------------------- *} {* Categories in Columns with Icons on Front Page - v4.0.x *} {* Set the number of columns ------------ *} {assign var='cols' value='4'} {* -------------------------------------- *} {capture name=dialog} {section name=cat_num loop=$subcategories} {if %cat_num.first%} <table width="100%" border="0" cellpadding="5" cellspacing="0"> {/if} {if %cat_num.index% is div by $cols} <tr> {/if} <td width="{math equation="100 / x" x=$cols}%" align="center" valign="top"> <a href="home.php?cat={$subcategories[cat_num].categoryid}"> <img src="{$xcart_web_dir}/icon.php?categoryid={$subcategories[cat_num].categoryid}" border="0" alt="{$subcategories[cat_num].category|escape}"> </a> <br /> <a href="home.php?cat={$subcategories[cat_num].categoryid}"><b>{$subcategories[cat_num].category|escape}</b></a> {if $config.Appearance.count_products eq "Y"} {if $subcategories[cat_num].product_count} <br /> {$subcategories[cat_num].product_count} {$lng.lbl_items} {/if} {if $subcategories[cat_num].subcategory_count} <br /> {$subcategories[cat_num].subcategory_count} {$lng.lbl_subcategories} {/if} {/if} </td> {if %cat_num.last%} </tr> </table> {/if} {/section} {/capture} {include file="dialog.tpl" title=$lng.lbl_categories content=$smarty.capture.dialog extra="width=100%"}

Code for v4.1.x

Code:
{* -------------------------------------- *} {* Categories in Columns with Icons on Front Page - v4.1.x *} {* Set the number of columns ------------ *} {assign var='cols' value='4'} {* -------------------------------------- *} {capture name=dialog} {foreach from=$categories item=c name=cats} {if $smarty.foreach.cats.first} <table width="100%" border="0" cellpadding="5" cellspacing="0"> {/if} {if $smarty.foreach.cats.index is div by $cols} <tr> {/if} <td width="{math equation="100 / x" x=$cols}%" align="center" valign="top"> <a href="home.php?cat={$c.categoryid}"> <img src="{$xcart_web_dir}/image.php?id={$c.categoryid}&amp;type=C" border="0" alt="{$c.category}"> </a> <br /> <a href="home.php?cat={$c.categoryid}"><b>{$c.category}</b></a> {if $config.Appearance.count_products eq "Y"} {if $c.product_count} <br /> {$c.product_count} {$lng.lbl_items} {/if} {if $c.subcategory_count} <br /> {$c.subcategory_count} {$lng.lbl_subcategories} {/if} {/if} </td> {if $smarty.foreach.cats.last} </tr> </table> {/if} {/foreach} {/capture} {include file="dialog.tpl" title=$lng.lbl_categories content=$smarty.capture.dialog extra="width=100%"}

3) Upload the new file created to skin1/customer/main/

4) Then in...

skin1/customer/main/welcome.tpl

Add..

Code:
{include file="customer/main/cats_in_cols_v40x.tpl"}

or...

Code:
{include file="customer/main/cats_in_cols_v41x.tpl"}

Done
__________________
xcartmods.co.uk
Reply With Quote

The following user thanks PhilJ for this useful post:
onetoremember (01-21-2011)
  #2  
Old 07-12-2007, 06:36 AM
 
jayzee jayzee is offline
 

Advanced Member
  
Join Date: Oct 2004
Posts: 53
 

Default Re: Categories in Columns on Front Page v4.x

Hi thanks for this, I was wondering if you know how i can get next level of subcategories to appear below the first levelof subcategories on x-cart 4.1?

thanks
J
__________________
Hi I\'m using x-cart 4.0 and 4.1
Reply With Quote
  #3  
Old 08-30-2007, 12:52 PM
  DataViking's Avatar 
DataViking DataViking is offline
 

eXpert
  
Join Date: Jan 2003
Location: Las Vegas, NV
Posts: 361
 

Default Re: Categories in Columns on Front Page v4.x

thank you
__________________
Web Design Web Design and Custom X-Cart Projects

http://www.dataviking.com

Mention the forums for discounts!
x-cart Version 4.1.8
Reply With Quote
  #4  
Old 09-01-2007, 01:23 AM
  vtonya's Avatar 
vtonya vtonya is offline
 

Advanced Member
  
Join Date: Apr 2007
Posts: 61
 

Default Re: Categories in Columns on Front Page v4.x

Where can we see a demo?
Thank you!
__________________
X-card Gold 4.1.7
Batch Order Mod/Order Processing
Detailed Order Management Mod
Order Audit/Profit reports
Advanced Product Search
Ajax Username Checker
Direct Product Enquiry Form
FAQ Manager
Social Bookmarking
Tabs Mod v3
MagneticOne.com All-IN-ONE X-Cart Export
Show Referrer Information on Order Details Page
www.medsmarket.net
Reply With Quote
  #5  
Old 09-01-2007, 03:22 AM
 
PhilJ PhilJ is offline
 

X-Guru
  
Join Date: Nov 2002
Posts: 4,094
 

Default Re: Categories in Columns on Front Page v4.x

http://www.xcartmods.co.uk/demos/416
__________________
xcartmods.co.uk
Reply With Quote
  #6  
Old 09-01-2007, 03:29 AM
  vtonya's Avatar 
vtonya vtonya is offline
 

Advanced Member
  
Join Date: Apr 2007
Posts: 61
 

Default Re: Categories in Columns on Front Page v4.x

Thank you PhilJ!
__________________
X-card Gold 4.1.7
Batch Order Mod/Order Processing
Detailed Order Management Mod
Order Audit/Profit reports
Advanced Product Search
Ajax Username Checker
Direct Product Enquiry Form
FAQ Manager
Social Bookmarking
Tabs Mod v3
MagneticOne.com All-IN-ONE X-Cart Export
Show Referrer Information on Order Details Page
www.medsmarket.net
Reply With Quote
  #7  
Old 09-12-2007, 07:55 PM
 
Chris B Chris B is offline
 

eXpert
  
Join Date: Oct 2002
Posts: 226
 

Default Re: Categories in Columns on Front Page v4.x

Is there a method to limit the number of categories listed?

Say I only want the 1st 6.

version 4.0.18

Thank you,

PS. very nice mod!
__________________
4.0x - 4.5x
Reply With Quote
  #8  
Old 09-13-2007, 09:30 AM
 
PhilJ PhilJ is offline
 

X-Guru
  
Join Date: Nov 2002
Posts: 4,094
 

Default Re: Categories in Columns on Front Page v4.x

I could probably code it to show only certain categories, pm if interested.
__________________
xcartmods.co.uk
Reply With Quote
  #9  
Old 09-25-2007, 11:50 AM
 
sjbt sjbt is offline
 

Advanced Member
  
Join Date: Jun 2007
Posts: 35
 

Default Re: Categories in Columns on Front Page v4.x

Is there a way to keep it from displaying the heading, "Categories"?

I have 4 categories and just want to display them with their images across the top.

Thanks!
__________________
X-Cart 4.1.8
Reply With Quote
  #10  
Old 09-25-2007, 11:56 AM
 
PhilJ PhilJ is offline
 

X-Guru
  
Join Date: Nov 2002
Posts: 4,094
 

Default Re: Categories in Columns on Front Page v4.x

remove...
Code:
{capture name=dialog}
and...
Code:
{/capture} {include file="dialog.tpl" title=$lng.lbl_categories content=$smarty.capture.dialog extra="width=100%"}
__________________
xcartmods.co.uk
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions


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 01:50 PM.

   

 
X-Cart forums © 2001-2020