I work with Smarty. I want to add a condition if elseto my file .tplfor n / i-child classes li / div.
I have two image sizes. I want to use a 600px image in the first li, 400px image in the 2nd and 3rd and again a 600px image in the 4th li, etc.
I am currently using the CSS3 selector nth-childand using scaled images of 400 pixels. But the loading time is bad. I want to use smaller images if necessary.
I think it is very difficult. It?
Here is my code:
<img src="{$purl}/thumbs/{$posts[i].pic}" alt="{$posts[i].story|stripslashes}" />
and exists in a loop {section name=i loop=$posts} {include file="posts.tpl"} {/section}inside posts.tpl.
source
share