Author Topic: Listing Categories In 6 Equal Columns  (Read 1165 times)

0 Members and 1 Guest are viewing this topic.

Offline a4evermedia

  • Global Moderator
  • Full Member
  • ***
  • Posts: 122
  • Karma: +25/-0
  • Gender: Male
    • View Profile
    • A4Ever Media
Listing Categories In 6 Equal Columns
« on: April 30, 2012, 05:20:17 AM »
I am looking for an efficient way to list categories in 6 columns.  Any suggestions would be greatly appreciated.

Offline a4evermedia

  • Global Moderator
  • Full Member
  • ***
  • Posts: 122
  • Karma: +25/-0
  • Gender: Male
    • View Profile
    • A4Ever Media
Listing Categories In 6 Equal Columns
« Reply #1 on: May 21, 2012, 06:58:51 AM »
Please let me know if this works for anybody else:

{categories var=$categories order=name}
{assign var=$startswith value='ZZ'}
{assign var=$per_column value=ceil(count($categories)/6)}






{foreach var=$c from=$categories counter=$counter}
{if $c.name[0] != $startswith}
{assign var=$startswith value=$c.name[0]}
{$c.name[0]|htmlspecialchars}
{/if}
{$c.name|htmlspecialchars}
{if $counter % $per_column == 0}

{/if}
{/foreach}
« Last Edit: May 25, 2012, 07:55:09 PM by a4evermedia »

Unofficial JMB Support Forums

Listing Categories In 6 Equal Columns
« Reply #1 on: May 21, 2012, 06:58:51 AM »


Tags:
 

Related Topics

  Subject / Started by Replies Last post
0 Replies
1360 Views
Last post April 29, 2012, 01:52:28 PM
by a4evermedia
0 Replies
1271 Views
Last post May 23, 2012, 06:14:47 PM
by a4evermedia
0 Replies
892 Views
Last post March 01, 2013, 08:18:35 PM
by remati
0 Replies
832 Views
Last post December 23, 2013, 09:40:04 AM
by punaniman