Using each to iterate over the passed in data - jquery-templates

If an array is passed to a jquery template directly(without it being a property of an object) how do I iterate over it?
ex:
var hired=[{name:'Jack'}, {name:'Jack'}, {name:'Jack'}]
This is the data passed to the template below:
Template Start
<div>
<table>
{{each $data}}
<tr>
<td width="250" align="left">${$value.name}</th>
<td width="150" align="center">${$value.name}</th>
<td width="60" align="center">${$value.name}</th>
</tr>
{{/each}}
</table>
</div>
Template End
Since there is no property name to refer to the passed in data, I tried using $data but it doesn't work. How can I get access to the array here?
Thanks a lot.

If you pass an array to tmpl, it will automatically apply the template to each element. Isn't that what you want?
var hired = [{name:'Jack'}, {name:'Jack'}, {name:'Jack'}];
With template:
<script id="hired-template" type="text/x-jquery-tmpl">
<tr>
<!-- I think you originally closed these with 'th' by mistake. -->
<td width="250" align="left">${name}</td>
<td width="150" align="center">${name}</td>
<td width="60" align="center">${name}</td>
</tr>
</script>
<table id="hired-table"></table>
This should allow you to do:
$('#hired-template').tmpl(hired).appendTo('#hired-table');
And get:
<table id="hired-table">
<tr>
<td width="250" align="left">Jack</td>
<td width="150" align="center">Jack</td>
<td width="60" align="center">Jack</td>
</tr>
<tr>
<td width="250" align="left">Jack</td>
<td width="150" align="center">Jack</td>
<td width="60" align="center">Jack</td>
</tr>
<tr>
<td width="250" align="left">Jack</td>
<td width="150" align="center">Jack</td>
<td width="60" align="center">Jack</td>
</tr>
</table>
Of course, I'm not sure if you meant to have "Jack" appear a total of nine times; but that seems to be what your code would do if it worked.

HTML:
<table id="tableID">
</table>
javascript:
var hired=[{name:'Jack'}, {name:'Jimmy'}, {name:'Ron'}]
for( var i=0; i < hired.length; i++ ) {
$( "#tableID" ).append(
"<tr> \
<td width=\"250\" align=\"left\">" + hired[ i ].name + "</td> \
<td width=\"150\" align=\"center\"> " + hired[ i ].name + " </td> \
<td width=\"60\" align=\"center\"> " + hired[ i ].name + " </td> \
</tr>"
);
};
let me know if you can't understand something.

Related

how to pass variable in HTML tag in flutter and load into WebView

I want to pass this name variable in input tag value in flutter dart
var name = 'tarun';
<tr>
<td width="28%" align="right" valign="middle" class="labelfont">AMOUNT: </td>
<td width="65%" align="left" valign="middle"><input
type="text" name="AMOUNT" class="signuptextfield" value= 'name' autocomplete="off"/></td>
<td width="7%" align="left" valign="middle"> </td>
</tr>
At first, change html code to String.
And add a variable with '$' in changed html string.
var name = 'tarun';
String html = """<tr>
<td width="28%" align="right" valign="middle" class="labelfont">AMOUNT: </td>
<td width="65%" align="left" valign="middle"><input
type="text" name="AMOUNT" class="signuptextfield" value=$name autocomplete="off"/></td>
<td width="7%" align="left" valign="middle"> </td>
</tr>""";
You may reefer to following:
var name = 'xyz';
String html = """<tr>
<td width="28%" align="right" valign="middle" class="labelfont">AMOUNT: </td>
<td width="65%" align="left" valign="middle"><input
type="text" name="NAME" class="signuptextfield" value=$name autocomplete="off"/></td>
<td width="7%" align="left" valign="middle"> </td>
</tr>""";

Image and table side-by-side, display:inline don't work in Outlook

I created a html email, it's working correctly in Thunderbird and Gmail but not in Outlook.
I want to have side by side one image and on table.
I use display:inline in order to do that.
But Outlook show the image and below the table.
Here the code:
http://jsfiddle.net/675db7ca/1/
<br/>
<div style="display:inline !important"><a href="http://www.google.com/" style="text-decoration:none">
<img border="0" height="106" width="186" src="http://pheonix.jw.lt/killercat186px.jpg" alt="logo"/>
</a></div><table cellspacing="0" style="table-layout: fixed; display:inline !important; max-width:412px; border-collapse:collapse; mso-table-lspace:0pt; mso-table-rspace:0pt;" cellpadding="0" border="0" width="412">
<tbody>
<tr>
<td width="200" border="0" style="vertical-align: bottom">
<span style="font-family:Helvetica;font-size:17px;color:#000000;">Super Scral</span>
<br/>
<span style="font-family:Helvetica;font-size:16px;color:green;">Developper</span>
</td>
<td width="20" style="background-image: url('http://s.atchik-services.com/signature/signature_lignerouge.png');" rowspan="3">
<div id="lignerouge"></div>
</td>
<td width="150" rowspan="2" border="0">
<span style="font-family:Helvetica;font-size:12px; color:#000001;"><strong>Tel</strong> : <a style="line-height:12px;padding:0px;margin:0px;color:#000001;text-decoration:none;" href="tel:0033xxxxxxxx">+33 <strong>x xx xx xx xx</strong></a>
</span>
<br/>
<span style="font-family:Helvetica;font-size:12px; color:#000001;"><strong>Site</strong>:
<a style="line-height:12px;padding:0px;margin:0px;color:#000001;" href="http://www.google.com/">google.com</a></span>
</td>
</tr>
</tbody>
</table>
<br/>
Thanks!
I can't really understand what it is that you are asking for help on.
I'm guessing you want the image next to the text, rather than above...
Put the image in a cell in that same table
<table cellspacing="0" style="max-width:412px; border-collapse:collapse; mso-table-lspace:0pt; mso-table-rspace:0pt;" cellpadding="0" border="0" width="412">
<tbody>
<tr>
<td><a href="http://www.google.com/" style="text-decoration:none">
<img border="0" height="106" width="186" src="http://pheonix.jw.lt/killercat186px.jpg" alt="logo"/>
</a></td>
<td width="200" border="0" style="vertical-align: bottom">
<span style="font-family:Helvetica;font-size:17px;color:#000000;">Super Scral</span>
<br/>
<span style="font-family:Helvetica;font-size:16px;color:green;">Developper</span>
</td>
<td width="20" style="background-image: url('http://s.atchik-services.com/signature/signature_lignerouge.png');" rowspan="3">
<div id="lignerouge"></div>
</td>
<td width="150" rowspan="2" border="0">
<span style="font-family:Helvetica;font-size:12px; color:#000001;"><strong>Tel</strong> : <a style="line-height:12px;padding:0px;margin:0px;color:#000001;text-decoration:none;" href="tel:0033xxxxxxxx">+33 <strong>x xx xx xx xx</strong></a>
</span>
<br/>
<span style="font-family:Helvetica;font-size:12px; color:#000001;"><strong>Site</strong>:
<a style="line-height:12px;padding:0px;margin:0px;color:#000001;" href="http://www.google.com/">google.com</a></span>
</td>
</tr>
</tbody>
</table>
Best not to bother with divs in email if you don't know a lot about email client quirks.
Display:inline/block/etc won't work on elements like tables. Don't bother with things like that.

Images not lining up in Gmail and outlook

Almost at breaking point with this. Coding this in dreamweaver and when I view it in the live mode comes up fine but when in live mode, but when I send it through the email clients such as outlook and gmail, it has one images out of line and i can't see why. New to this so sorry if code is a bit messy.
</head>
<body leftmargin="0" marginwidth="0" topmargin="0" marginheight="0" offset="0">
<center>
<table border="0" cellpadding="0" cellspacing="0" height="100%" width="100%" id="backgroundTable">
<tr>
<td align="center" valign="top">
<!-- // Begin Template Preheader \\ -->
<table border="0" cellpadding="10" cellspacing="0" width="600" id="templatePreheader">
<tr>
<td valign="top" class="preheaderContent">
<!-- // Begin Module: Standard Preheader \ -->
<table border="0" cellpadding="10" cellspacing="0" width="100%">
<tr>
<td valign="top">
<div mc:edit="std_preheader_content">
</div>
</td>
<!-- *|IFNOT:ARCHIVE_PAGE|* -->
<td valign="top" width="190">
<div mc:edit="std_preheader_links">
Is this email not displaying correctly?<br />View it in your browser.
</div>
</td>
<!-- *|END:IF|* -->
</tr>
</table>
<!-- // End Module: Standard Preheader \ -->
</td>
</tr>
</table>
<!-- // End Template Preheader \\ -->
<table border="0" cellpadding="0" cellspacing="0" width="600" id="templateContainer">
<tr>
<td align="center" valign="top">
<!-- // Begin Template Header \\ -->
<table border="0" cellpadding="0" cellspacing="0" width="600" id="templateHeader">
<tr>
<td style="padding-top:25px">
</td>
</tr>
<tr>
<td class="headerContent">
<!-- // Begin Module: Standard Header Image \\ -->
<img src="http://www.spaceform.com/SF/media/site/Newsletters/Email%20Test%20Images/logo1.png" style="max-width:600px; font-family:Tahoma; font-size:32px; color:#000000" alt="Spaceform London" id="headerImage campaign-icon" mc:label="header_image" mc:edit="header_image" mc:allowdesigner mc:allowtext/>
<!-- // End Module: Standard Header Image \\ -->
</td>
</tr>
<tr>
<td style="padding-top:10px">
</td>
</tr>
<tr>
<td align="center" style="font-family:Tahoma; font-size:14px; padding-top:15px; padding-bottom:15px">
Home | Shop | Bestselling Gifts | Personalised Gifts | About Spaceform | Contact us</td>
</tr>
</table>
<!-- // End Template Header \\ -->
</td>
</tr>
<tr>
<td align="center" valign="top">
<!-- // Begin Template Body \\ -->
<table border="0" cellpadding="0" cellspacing="0" width="600" id="templateBody">
<tr>
<td valign="top">
<table border="0" cellpadding="0" cellspacing="0" width="600">
<tr>
<td valign="top">
<table border="0" cellpadding="0" cellspacing="0" width="600">
<tr>
<td valign="top" class="bodyContent">
<!-- // Begin Module: Standard Content \\ -->
<table border="0" bordercolor="#FFFFFF" style="background-color:#FFFFFF" width="600" cellpadding="0" cellspacing="0">
<tr>
<td rowspan="18" width="24" height="1474"><img src="http://www.spaceform.com/SF/media/email/trade/giftideas/cell_02.jpg" border="0" style="display:block;" width="24" height="1474" /></td>
<td colspan="2" width="552" height="43"><img src="http://www.spaceform.com/SF/media/email/trade/giftideas/cell_03.jpg" border="0" style="display:block;" width="552" height="43" /></td>
<td rowspan="18" width="24" height="1474"><img src="http://www.spaceform.com/SF/media/email/trade/giftideas/cell_04.jpg" border="0" style="display:block;" width="24" height="1474" /></td>
</tr>
<tr>
<td background="http://www.spaceform.com/SF/media/email/trade/giftideas/cell_05.jpg" style="display:block;" bgcolor="#ffffff" width="279" height="122" valign="top">
<!--[if gte mso 9]>
<v:rect xmlns:v="urn:schemas-microsoft-com:vml" fill="true" stroke="false" style="width:279px;height:122px;">
<v:fill type="tile" src="http://www.spaceform.com/SF/media/email/trade/giftideas/cell_05.jpg" color="#ffffff" />
<v:textbox inset="0,0,0,0">
<![endif]-->
<div>
Lorem ipsum dolor sit amet,</div>
<!--[if gte mso 9]>
</v:textbox>
</v:rect>
<![endif]-->
</td>
<td width="273" height="350" rowspan="3"><img src="http://www.spaceform.com/SF/media/email/trade/giftideas/cell_06.jpg" border="0" style="display:block;" width="273" height="350" /></td>
</tr>
<tr>
<td width="279" height="45"><img src="http://www.spaceform.com/SF/media/email/trade/giftideas/cell_07.jpg" border="0" style="display:block;" width="279" height="45" /></td>
</tr>
<tr>
<td width="279" height="183"><img src="http://www.spaceform.com/SF/media/email/trade/giftideas/cell_08.jpg" border="0" style="display:block;" width="279" height="183" /></td>
</tr>
<tr>
<td colspan="2" width="552" height="41"><img src="http://www.spaceform.com/SF/media/email/trade/giftideas/cell_09.jpg" border="0" style="display:block;" width="552" height="41" /></td>
</tr>
<tr>
<td rowspan="3" width="279" height="233"><img src="http://www.spaceform.com/SF/media/email/trade/giftideas/cell_10.jpg" border="0" style="display:block;" width="279" height="233" /></td>
<td background="http://www.spaceform.com/SF/media/email/trade/giftideas/cell_11.jpg" style="display:block;" bgcolor="#ffffff" width="273" height="93" valign="top">
<!--[if gte mso 9]>
<v:rect xmlns:v="urn:schemas-microsoft-com:vml" fill="true" stroke="false" style="width:273px;height:93px;">
<v:fill type="tile" src="http://www.spaceform.com/SF/media/email/trade/giftideas/cell_11.jpg" color="#ffffff" />
<v:textbox inset="0,0,0,0">
<![endif]-->
<div>
Lorem ipsum dolor sit amet,</div>
<!--[if gte mso 9]>
</v:textbox>
</v:rect>
<![endif]-->
</td>
</tr>
<tr>
<td width="273" height="37"><img src="http://www.spaceform.com/SF/media/email/trade/giftideas/cell_12.jpg" border="0" style="display:block;" width="273" height="37" /></td>
</tr>
<tr>
<td width="273" height="103"><img src="http://www.spaceform.com/SF/media/email/trade/giftideas/cell_13.jpg" border="0" style="display:block;" width="273" height="103" /></td>
</tr>
<tr>
<td colspan="2" width="552" height="47"><img src="http://www.spaceform.com/SF/media/email/trade/giftideas/cell_14.jpg" border="0" style="display:block;" width="552" height="47" /></td>
</tr>
<tr>
<td rowspan="3" width="279" height="317"><img src="http://www.spaceform.com/SF/media/email/trade/giftideas/cell_15.jpg" border="0" style="display:block;" width="279" height="317" /></td>
<td background="http://www.spaceform.com/SF/media/email/trade/giftideas/cell_16.jpg" style="display:block;" bgcolor="#ffffff" width="273" height="95" valign="top">
<!--[if gte mso 9]>
<v:rect xmlns:v="urn:schemas-microsoft-com:vml" fill="true" stroke="false" style="width:273px; height:95px">
<v:fill type="tile" src="http://www.spaceform.com/SF/media/email/trade/giftideas/cell_16.jpg" color="#ffffff" />
<v:textbox style="mso-fit-shape-to-text:true" inset="0,0,0,0">
<![endif]-->
<div>
Lorem ipsum dolor sit amet,</div>
<!--[if gte mso 9]>
</v:textbox>
</v:rect>
<![endif]-->
</td>
</tr>
<tr>
<td width="273" height="35"><img src="http://www.spaceform.com/SF/media/email/trade/giftideas/cell_17.jpg" border="0" style="display:block;" width="273" height="35" /></td>
</tr>
<tr>
<td width="273" height="187"><img src="http://www.spaceform.com/SF/media/email/trade/giftideas/cell_18.jpg" border="0" style="display:block;" width="273" height="187" /></td>
</tr>
<tr>
<td colspan="2" width="552" height="41"><img src="http://www.spaceform.com/SF/media/email/trade/giftideas/cell_19.jpg" border="0" style="display:block;" width="552" height="41" /></td>
</tr>
<tr>
<td background="http://www.spaceform.com/SF/media/email/trade/giftideas/cell_20.jpg" style="display:block;" bgcolor="#ffffff" width="279" height="96" valign="top">
<!--[if gte mso 9]>
<v:rect xmlns:v="urn:schemas-microsoft-com:vml" fill="true" stroke="false" style="width:279px;height:96px;">
<v:fill type="tile" src="http://www.spaceform.com/SF/media/email/trade/giftideas/cell_20.jpg" color="#ffffff" />
<v:textbox inset="0,0,0,0">
<![endif]-->
<div>
Lorem ipsum dolor sit amet, </div>
<!--[if gte mso 9]>
</v:textbox>
</v:rect>
<![endif]-->
</td>
<td rowspan="3" width="273" height="293"><img src="http://www.spaceform.com/SF/media/email/trade/giftideas/cell_21.jpg" border="0" style="display:block;" width="273" height="293" /></td>
</tr>
<tr>
<td width="279" height="38"><img src="http://www.spaceform.com/SF/media/email/trade/giftideas/cell_22.jpg" border="0" style="display:block;" width="279" height="38" /></td>
</tr>
<tr>
<td width="279" height="159"><img src="http://www.spaceform.com/SF/media/email/trade/giftideas/cell_23.jpg" border="0" style="display:block;" width="279" height="159" /></td>
</tr>
<tr>
<td colspan="2" width="552" height="40"><img src="http://www.spaceform.com/SF/media/email/trade/giftideas/cell_24.jpg" border="0" style="display:block;" width="552" height="40" /></td>
</tr>
<tr>
<td colspan="2" width="279" height="69"><img src="http://www.spaceform.com/SF/media/email/trade/giftideas/cell_25.jpg" border="0" style="display:block;" width="552" height="85">
</td>
</tr>
<td colspan="4" width="600" height="45"><img src="http://www.spaceform.com/SF/media/email/trade/giftideas/cell_26.jpg" border="0" style="display:block;" width="600" height="45" /></td>
</tr>
<tr>
<td colspan="4" width="600" height="324"><img src="http://www.spaceform.com/SF/media/email/trade/giftideas/cell_27.jpg" border="0" style="display:block;" width="600" height="324" /></td>
</tr>
</table>
<!-- // End Module: Standard Content \\ -->
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
<!-- // End Template Body \\ -->
</td>
</tr>
<tr>
<td align="center" valign="top">
<!-- // Begin Template Footer \\ -->
<table border="0" cellpadding="10" cellspacing="0" width="600" id="templateFooter">
<tr>
<td valign="top" class="footerContent">
<!-- // Begin Module: Standard Footer \\ -->
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td colspan="2" valign="middle" id="social" style="padding-bottom:20px">
<div mc:edit="std_social" style="font-size: 14px; font-style:normal">
We love being social,
why not come and say hi... <img src="http://www.spaceform.com/SF/media/site/Newsletters/Email%20Test%20Images/facebook2.png" alt="on Facebook" style="max-width:600px; id="Img9" mc:label="header_image" mc:edit="header_image" mc:allowdesigner mc:allowtext />
<img src="http://www.spaceform.com/SF/media/site/Newsletters/Email%20Test%20Images/twitter2.png" alt="on Twitter" style="max-width:600px; id="Img10" mc:label="header_image" mc:edit="header_image" mc:allowdesigner mc:allowtext />
<img src="http://www.spaceform.com/SF/media/site/Newsletters/Email%20Test%20Images/pinterest2.png" alt="or on Pinterest" style="max-width:600px; id="Img11" mc:label="header_image" mc:edit="header_image" mc:allowdesigner mc:allowtext />
</div>
</td>
</tr>
<tr>
<td valign="top" width="350">
<div mc:edit="std_footer">
<em>Copyright © *|CURRENT_YEAR|* *|LIST:COMPANY|*, All rights reserved. >
<br />
*|IFNOT:ARCHIVE_PAGE|* *|LIST:DESCRIPTION|*
<br />
<strong>Our mailing address is:</strong>
<br />
*|HTML:LIST_ADDRESS_HTML|**|END:IF|*
</div>
</td>
<td valign="top" width="190" id="monkeyRewards">
<div mc:edit="monkeyrewards">
*|IF:REWARDS|* *|HTML:REWARDS|* *|END:IF|*
</div>
</td>
</tr>
<tr>
<td colspan="2" valign="middle" id="utility">
<div mc:edit="std_utility">
unsubscribe from this list | update subscription preferences<br />
</div>
</td>
</tr>
</table>
<!-- // End Module: Standard Footer \\ -->
</td>
</tr>
</table>
<!-- // End Template Footer \\ -->
</td>
</tr>
</table>
<br />
</td>
</tr>
</table>
</center>
</body>
You cant have empty <td>, outlook will ignore all styling you have made.
So insert a small transparent image inside them like <img src="Img/trans.png" height="1" width="1" style="display:block">
You dont have the <head> in the code so i Can see it, but remember you cant style with external css. Gmail removes everything in your header.. So everything needs to be inline styling
EDIT:
After looking a bit more on your code i can see you have lot of rowspan="" some mail client dosnt like that. If neede try only to use colspan, and not rowspan. All of the vertical pictures side by side can get ugly.
It looks like when you sliced the image you somehow lost a 16px high by 24px wide chunk off the bottom of each sidebar image.
The sidebar images, cell_02.jpg and cell_04.jpg, are 1474px tall while the center column images add to 1490px tall. The sidebar table cells get stretched vertically to match the height of the center column, leaving 16px of empty space, and center the images vertically, leaving 8px of empty space top and bottom.
I suggest you find the missing bits and make each sidebar image 16px taller. Alternatively, you could take a 16px slice off the bottom of cell_25.jpg, paste it to the top of cell_26.jpg, and fill in the missing corners.

how to add google analytics code in email

i am looking for a solutions for Google Analytics, can i add Google Analytics in our email.
<div>
<table width="600" border="0" cellspacing="2" cellpadding="2" style="background-color:#FFF; font-family:Verdana, Geneva, sans-serif; font-size:12px;">
<tr>
<td height="25" style="text-align:left;">MESSAGE</td>
</tr>
<tr>
<td height="25" style="text-align:left;">URL</td>
</tr>
<tr>
<td height="25" style="text-align:left;">NEED TO PUT GOOGLE CODE HERE</td>
</tr>
<tr>
<tr>
<td height="25" style="text-align:right;">Powered by XXX.</td>
</tr>
</table>
</div>
Thanks
You would append the campaign tracking parameters to the URL. You can use Google's URL Builder to build these. Essentially, your link would look something like this:
<tr>
<td height="25" style="text-align:left;">http://example-landing-page.com/test?utm_source=exampleSource&utm_medium=Email&utm_term=awesomeKeyword&utm_content=goodContent&utm_campaign=bestCampaignEver</td>
</tr>

Smarty Tag help

I am using an engine, where for forums Vbulletin is used and for Other thiiings social engine 3 is used,
This was done by some professionals
In one of the page I am having popular tags(In Social Engine)
Its too long I want shortened it,
How can I do it?
here is my code
{* SHOW POPULAR TAGS START *}
<tr>
<td align="left" valign="top"><img src="images/spacer.gif" alt="" width="1" height="10" /></td>
</tr>
<tr>
<td align="left" valign="top"><table width="220" border="0" align="left" cellpadding="0" cellspacing="0">
<tr>
<td width="12" align="left" valign="top"><img src="images/blog_belowtl.jpg" alt="" width="12" height="10" /></td>
<td width="196" align="left" valign="top" background="images/blog_belowtbg.jpg"><img src="images/spacer.gif" width="1" height="10" /></td>
<td width="12" align="right" valign="top"><img src="images/blog_belowtr.jpg" alt="" width="12" height="10" /></td>
</tr>
<tr>
<td align="left" valign="top" background="images/blog_belowlbg.jpg" style="background-repeat: repeat-y;"> </td>
<td align="left" valign="top"><table width="196" border="0" align="left" cellpadding="0" cellspacing="0">
<tr>
<td align="left" valign="top" >
{*<div class="articletags" >
{foreach from=$popular_tags item=poptag}
<a class="tag{$poptag.class}" href="articles.php?tag={$poptag.name}">{$poptag.name}</a>
{/foreach}
</div>*}
{foreach from=$popular_tags item=poptag}
{if $poptag.count == '1' }
{assign var=cssClass value='tahoma15_cloud'}
{elseif $poptag.count == '2' }
{assign var=cssClass value='tahoma12bold_cloud'}
{elseif $poptag.count == '3'}
{assign var=cssClass value='tahoma13bold_cloud'}
{elseif $poptag.count == '4'}
{assign var=cssClass value='tahoma14bold_cloud'}
{elseif $poptag.count == '5'}
{assign var=cssClass value='tahoma15_cloud'}
{else}
{assign var=cssClass value='tahoma18bold_cloud'}
{/if}
<span class="{$cssClass}">{$poptag.name}</span>
{/foreach}
</td>
</tr>
</table></td>
<td align="left" valign="top" background="images/blog_belowrbg.jpg" style="background-repeat: repeat-y;"> </td>
</tr>
<tr>
<td align="left" valign="top"><img src="images/blog_belowbl.jpg" alt="" width="12" height="10" /></td>
<td align="left" valign="top" background="images/blog_belowbbg.jpg"><img src="images/spacer.gif" alt="" width="1" height="10" /></td>
<td align="right" valign="top"><img src="images/blog_belowbr.jpg" alt="" width="12" height="10" /></td>
</tr>
</table></td>
</tr>
{* SHOW POPULAR TAGS END *}
You can check the lenght of this tag, on this link
http://www.managementparadise.com/articles.php
Currently it is displaying very long on the widget area
I am new on this, so any help will be appreciated
:)
OK I edited
{section name=poptag loop=$popular_tags max=20}
{if $poptag.count == '1' }
{assign var=cssClass value='tahoma15_cloud'}
{elseif $poptag.count == '2' }
{assign var=cssClass value='tahoma12bold_cloud'}
{elseif $poptag.count == '3'}
{assign var=cssClass value='tahoma13bold_cloud'}
{elseif $poptag.count == '4'}
{assign var=cssClass value='tahoma14bold_cloud'}
{elseif $poptag.count == '5'}
{assign var=cssClass value='tahoma15_cloud'}
{else}
{assign var=cssClass value='tahoma18bold_cloud'}
{/if}
<span class="{$cssClass}">{$poptag.name}</span>
{/section}
You should replace the {foreach} template tag with a {section} tag and set the max attribute on it to limit the times it is executed.
http://www.smarty.net/docsv2/en/language.function.section.tpl