Jump to content

Smarty: Arrange attachments into columns


BryanB

Recommended Posts

I'm trying to display attachments on viewticket.tpl in 3 columns but I'm not sure how to get smarty templates to display an array in columns.

 

This is what I'm working with:

 

{foreach from=$reply.attachments key=num item=attachment} <img src="images/article.gif" class="absmiddle" border="0" alt="{$attachment}" /> <a href="dl.php?type=ar&id={$reply.id}&i={$num}">{$attachment}</a><br />

{/foreach}

 

Right now it just lists them all right under each other, but instead I would like to divide the attachments in to 3 columns, so if there were 12 it would make 3 columns of 4.

 

Any ideas?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use & Guidelines and understand your posts will initially be pre-moderated