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)
-   -   Need to display 2 column subcategory for only 1 category (https://forum.x-cart.com/showthread.php?t=21613)

guitarfish 05-06-2006 04:11 PM

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!

balinor 05-06-2006 04:14 PM

This thread should hook you up:

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

guitarfish 05-06-2006 04:22 PM

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!

balinor 05-06-2006 04:29 PM

{if $cat eq "9" or $cat eq "10" or $cat eq "11" or $cat eq "12"}

guitarfish 05-06-2006 04:48 PM

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!

amy2203 05-07-2006 12:32 AM

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

guitarfish 05-07-2006 08:00 AM

Thanks - that worked perfect!
Jeff


All times are GMT -8. The time now is 08:43 PM.

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