|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
jasonx Smarty Rookie
Joined: 04 Feb 2005 Posts: 11
|
Posted: Sat Mar 19, 2005 1:51 am Post subject: SmartyPaginate Creating a table for output |
|
|
Hey guys,
Firstly I've looked at http://www.phpinsider.com/php/code/SmartyPaginate/ the example.
My current code is:
Code: |
{section name=i loop=$profiles}
<a href="profile/{$profiles[i].username}"><img src="users/{$profiles[i].userid}/{$profiles[i].id}p.jpg" /></a>
{$profiles[i].username}
{$paginate.current_item}
{/section}
{paginate_prev} {paginate_middle} {paginate_next}
|
What I would like is for the output to be put into a table with say 4 columns.
So basically when the fourth column is meant a new <TR> begins. I've looked through the forum for examples but can't find anything. I did try outputting the current item number but all I get are 1's.
Can someone lead me in the right direction.
Thanks
Jason |
|
Back to top |
|
mohrt Administrator
Joined: 16 Apr 2003 Posts: 7368 Location: Lincoln Nebraska, USA
|
Posted: Mon Mar 21, 2005 2:55 pm Post subject: |
|
|
You could try something like:
Code: | {if $smarty.section.i.index is div by 4}
</tr><tr>
{/if} |
I can't remember if index or iteration is the right special var to use, try them both. |
|
Back to top |
|
jasonx Smarty Rookie
Joined: 04 Feb 2005 Posts: 11
|
Posted: Tue Mar 29, 2005 2:47 am Post subject: |
|
|
thanks mohrt.
{if $smarty.section.i.iteration is div by 4}
</tr><tr>
{/if}
worked a treat. |
|
Back to top |
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|