Thread: Site map page
View Single Post
  #19  
Old 03-16-2005, 09:42 AM
  Jon's Avatar 
Jon Jon is offline
 

X-Guru
  
Join Date: Oct 2002
Location: Vancouver, Canada
Posts: 4,200
 

Default

To do a 2 column layout, you could first, in PHP get a count of how many lines will be displayed. Divide that by 2 being sure to use ceil (so that if there's an uneven amount, the extra line is shown in the first column).

Assign that variable to smarty: $halfway

Then, prior to the section start a table:

Code:
<table><tr><td>

During your section, increase a variable to check against $halfway. When it gets there, start a new column.

Code:
{if $count eq $halfway}</td><tr><td>

Then after your section, of course close the table.

Code:
</td></tr></table>
[/code]
Reply With Quote