Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save whitperson/5509347 to your computer and use it in GitHub Desktop.
Save whitperson/5509347 to your computer and use it in GitHub Desktop.
<tr>
<!-- Start Active_collections TD -->
<td style="padding-bottom:10px; padding-top:20px;">
<table width="100%" cellspacing="0" cellpadding="0">
<!-- accesses array length to check if it's an odd or even number -->
{a = length(active)}
{if (a % 2) != 0}
{a = a - 1}
{/if}
<tr> <!-- 1st row of deals -->
<!-- -->
{foreach slice(active,0,a) as i, c }
<!-- Starts single collection item -->
<td valign="top" width="310">
<table width="100%" cellspacing="0" cellpadding="0">
<tr>
<td width="308" style="line-height:0; border:1px solid #ccc;" bgcolor="#cccccc"><a href="{c.url}"><img src="{c.image_url}" align="left" border="0" vspace="0" hspace="0" width="308" height="308" alt="" /></a></td>
</tr>
<tr>
<!-- calls the name for each of the client's product "collections" -->
<td style="font:20px/22px Georgia, Times, serif; color:#383838; text-transform:uppercase; padding:5px 0 0;">{c.name}</td>
</tr>
<tr>
<!-- calls the tagline for each of the client's product "collections" -->
<td style="font:14px/22px Georgia, Times, serif; color:#666; padding-bottom:2px;">{c.tagline}.</td>
</tr>
<tr>
<!-- calls the sale_end date from content array and converts to appropriate date format -->
<td style="font:14px/16px Georgia, Times, serif; color:#9e9d9d;"><b style="color:#df3c3c;"><i>Sale Ends
{sale_end = c.sale_ends}
{date("M/d",time(sale_end))}
</i></b> | <a href="{c.url}" style="text-decoration:none; color:#249efc;"><i>Shop Now</i></a></td>
</tr>
</table>
</td> <!-- Ends single collection item -->
{if (i % 2) != 0}
<!-- code for odd numbered index returns code for new row -->
</tr> <!-- ends row-->
<tr> <!-- space between rows -->
<td height="23" style="line-height:0; font-size:0;" colspan="3">&nbsp;</td>
</tr>
<tr> <!-- starts next new row-->
{else}
<!-- code for even numbered index returns code for td spacer only -->
<!-- TD spacer -->
<td width="10" style="line-height:0; font-size:0;"></td>
{/if}
{/foreach}
</tr>
</table></td>
</tr>
<tr>
<td height="36" style="line-height:0; font-size:0;">&nbsp;</td>
</tr>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment