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

Need to display 2 column subcategory for only 1 category

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 05-06-2006, 04:11 PM
 
guitarfish guitarfish is offline
 

Newbie
  
Join Date: Jul 2005
Posts: 8
 

Default Need to display 2 column subcategory for only 1 category

For my whole site I am displaying the categories in a 3 column format. What I want to do is display 2 column format only for a certain category.
In the subcategories.tpl there is a line that says
Quote:
{ if %cat_num.index% is div by 3}
I'm certain that there needs to be an if statement after that but I don't know where and what to put near this code.
Any help would be appreciated!
__________________
X-Cart 4.0.14 on Win XP, php 4, mysql 4.1
Reply With Quote
  #2  
Old 05-06-2006, 04:14 PM
 
balinor balinor is offline
 

Veteran
  
Join Date: Oct 2003
Location: Connecticut, USA
Posts: 30,253
 

Default

This thread should hook you up:

http://forum.x-cart.com/viewtopic.php?t=12234
__________________
Padraic Ryan
Ryan Design Studio
Professional E-Commerce Development
Reply With Quote
  #3  
Old 05-06-2006, 04:22 PM
 
guitarfish guitarfish is offline
 

Newbie
  
Join Date: Jul 2005
Posts: 8
 

Default

Quote:
Originally Posted by balinor
This thread should hook you up:

http://forum.x-cart.com/viewtopic.php?t=12234

Thanks for the quick reply! I've been to that post and got and idea but coudn't get anything related to an IF statement for multiple columns for a particular category. If you can find me the code I would be very gratefull!
__________________
X-Cart 4.0.14 on Win XP, php 4, mysql 4.1
Reply With Quote
  #4  
Old 05-06-2006, 04:29 PM
 
balinor balinor is offline
 

Veteran
  
Join Date: Oct 2003
Location: Connecticut, USA
Posts: 30,253
 

Default

{if $cat eq "9" or $cat eq "10" or $cat eq "11" or $cat eq "12"}
__________________
Padraic Ryan
Ryan Design Studio
Professional E-Commerce Development
Reply With Quote
  #5  
Old 05-06-2006, 04:48 PM
 
guitarfish guitarfish is offline
 

Newbie
  
Join Date: Jul 2005
Posts: 8
 

Default

Quote:
Originally Posted by balinor
{if $cat eq "9" or $cat eq "10" or $cat eq "11" or $cat eq "12"}
I'm not implementing it right for my lack of programming logic. Here is what
I tried but didn't work.
Quote:
{ if %cat_num.index% is div by 3}
{if $cat eq "1372" is div by 2}
<tr>
{/if}
{/if}
See if you can correct this please!
__________________
X-Cart 4.0.14 on Win XP, php 4, mysql 4.1
Reply With Quote
  #6  
Old 05-07-2006, 12:32 AM
  amy2203's Avatar 
amy2203 amy2203 is offline
 

X-Wizard
  
Join Date: Jul 2004
Location: Watford, UK
Posts: 1,509
 

Default

OK, not a programmer by any means, but you are checking to see if the catnum is a ultiple of 3, and then checking to see if it is a multiple of 2....

Code:
{ if %cat_num.index% is div by 3}

this line is checking to see if it is divisiable by 3 in order to start a new row, this creates a 3 column table... what you want to do is check against the cat num, and if true create a 2 column table, so I would do something like...

Code:
{if $cat eq "1372"} { if %cat_num.index% is div by 2} <tr> {/if} {else} { if %cat_num.index% is div by 3} <tr> {/if} {/if}

it may not be correct, but hth
__________________
X-Cart version 5 (Previously 3.5-4)

Previous Versions included
BCSE Reward Points Mod
Altered Cart On Sale Mod
Wordpress Plugin

Please don't PM me for support. I help where I can on the forum and your question will more likely be answered there.

Shout me a Coffee!
Reply With Quote
  #7  
Old 05-07-2006, 08:00 AM
 
guitarfish guitarfish is offline
 

Newbie
  
Join Date: Jul 2005
Posts: 8
 

Default

Thanks - that worked perfect!
Jeff
__________________
X-Cart 4.0.14 on Win XP, php 4, mysql 4.1
Reply With Quote
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design



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 10:25 AM.

   

 
X-Cart forums © 2001-2020