Jump to content

Downloads listing in multiple columns


resrec99

Recommended Posts

Is there any way of having all downloads listed throughout 3 columns instead of having them all listed in a single column?

 

i.e. Instead of having:

 

1

2

3

4

5

etc...

 

I would like to see:

 

1 2 3 4

5 6 7 8

etc..

 

I have tried adding <td>download_info</td> to the template file but all i get is 3 columns with exactly the same information in each cell.

 

Any ideas?

Link to comment
Share on other sites

  • 1 month later...

<table width="100%">

<tr>

{foreach key=num item=download from=$downloads}

<td>

{$download.type} <a href="{$download.link}"><strong>{$download.title}</strong></a><br />{if $download.clientsonly}<i>Login Required</i><br />{/if}{$download.description}<br /><font style="color:#A8A8A8;font-size:10px;">{$LANG.downloadsfilesize}: {$download.filesize}</font>

</td>

{if $num is div by 4}

</tr>

<tr>

{/if}

{/foreach}

</table>

 

 

I still have to fix that one single file in the first row...

Link to comment
Share on other sites

Here is the code:

{foreach key=num item=product from=$products}
<div class="cartbox" align="center">
<strong>{$product.name}</strong> {if $product.qty!=""}<em>({$product.qty} {$LANG.orderavailable})</em>{/if}<br />
{if $product.description}{$product.description}<br />{/if}
<div style="margin:5px;padding:2px;color:#cc0000;">
{if $product.paytype eq "free"}
{$LANG.orderfree}
{elseif $product.paytype eq "onetime"}
{$product.pricing.onetime} {$LANG.orderpaymenttermonetime}
{elseif $product.paytype eq "recurring"}
{if $product.pricing.monthly}{$product.pricing.monthly}<br />{/if}
{if $product.pricing.quarterly}{$product.pricing.quarterly}<br />{/if}
{if $product.pricing.semiannually}{$product.pricing.semiannually}<br />{/if}
{if $product.pricing.annually}{$product.pricing.annually}<br />{/if}
{if $product.pricing.biennially}{$product.pricing.biennially}<br />{/if}
{/if}
</div>
<div align="center"><input type="button" value="{$LANG.ordernowbutton}"{if $product.qty eq "0"} disabled{/if} onclick="window.location='{$smarty.server.PHP_SELF}?a=add&pid={$product.pid}'" /></div>
</div>
<br />
{/foreach}

 

How do I align this like yours? Thanks!

Link to comment
Share on other sites

New code:

 

{if $downloads}

 

<p><strong>{$LANG.downloadsfiles}</strong></p>

 

<table width="100%">

<tr>

{foreach key=num item=download from=$downloads}

<td width="33%" valign="top">{$download.description}<p>{$download.type} <a href="{$download.link}"><strong>{$download.title}</strong></a><br />{if $download.clientsonly}{if !$loggedin}<i>Exclusivo para clientes</i>{/if}{/if}<br /><font style="color:#A8A8A8;font-size:10px;">{$LANG.downloadsfilesize}: {$download.filesize}</font>

</td>

 

{if ($num + 1) is div by 3}

</tr>

<tr>

{/if}

 

{/foreach}

</tr>

</table>

{else}

 

No downloads...

{/if}

 

 

This one shows the correct 3 columns (to change the number of columns change the div by 3, where 3 is the number of columns....)

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