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

How Can I do this. . .

 
Reply
   X-Cart forums > X-Cart 4 > Dev Questions > Changing design
 
Thread Tools Search this Thread
  #1  
Old 03-25-2010, 05:46 AM
  inkcarts's Avatar 
inkcarts inkcarts is offline
 

Advanced Member
  
Join Date: Sep 2008
Location: Crowley Louisiana
Posts: 45
 

Default How Can I do this. . .

Let's say I have a Category, with X number of subcategories. . .

I'd like to lay them out in 4 columns, instead of reading left to right though, I'd like to lay them out in 4 columns, top to bottom. . Let me see if i can explain that better. . . .


I'd like to count the number of subcategories, then divide by the number of columns.

So, if there are 100 subcategories, and I want them in 4 columns. .

100/4 = 25 in each column

<ul>
then 25 <li>subcat</li>'s
</ul>
<ul>
then 25 more <li>subcat</li>'s
</ul>
<ul>
then 25 more <li>subcat</li>'s
</ul>
<ul>
then 25 more <li>subcat</li>'s
</ul>

Any ideas how I can do this?

Thanks!
Lyn
__________________
Lyn Askin
X-Cart 4.2.3
MICR Toner
Toner Cartridges
X-Cart Search Engine Optimization
Reply With Quote
  #2  
Old 03-25-2010, 01:44 PM
  gizmo's Avatar 
gizmo gizmo is offline
 

X-Adept
  
Join Date: Jan 2005
Location: Crawley : UK
Posts: 618
 

Default Re: How Can I do this. . .

They only solution I can give is to create your categories and then manually code it to show your own css driven style categories (Exactly as you want it) I don't think this would be possible with x-carts css, and code...

Maybe there is some one with better knowledge than me though that can help.
__________________
Thank You - Alan
Don't be like me, and keep saying "Nearly did it" go do it!!
Version: 4.4.4 Gold -
Reply With Quote
  #3  
Old 03-27-2010, 02:14 PM
  gb2world's Avatar 
gb2world gb2world is offline
 

X-Wizard
  
Join Date: May 2006
Location: Austin, TX
Posts: 1,970
 

Default Re: How Can I do this. . .

You should be able to do it using smarty or php.

In smarty:
Your subcategories are in this array: $subcategories
number of items in the array: {$subcategories|@count}
You can set smarty variables to determine the subcats per column:
{assign var="subcats_count" value=$subcategories|@count}
{assign var="subcats_per_section" value=$subcats_count/4}

You can create loops in smarty using the variables to get the desired outcome. You can set a variable inside your loop to count where you are, and when you reach the desired subcategory count, you can start a new unordered list.
__________________
X-CART (4.1.9,12/4.2.2-3/4.3.1-2/4.4.1-5)-Gold
(CDSEO, Altered-Cart On Sale, BCSE Preorder Backorder, QuickOrder, X-Payments, BCSE DPM Module)
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 02:44 AM.

   

 
X-Cart forums © 2001-2020