Jump to content

Не могу разобраться с условием smarty((

Recommended Posts

Ребята помогите разобраться/дописать условие в Homefeatured.tpl..


<li class="ajax_block_product {if $smarty.foreach.homeFeaturedProducts.first}first_item{elseif $smarty.foreach.homeFeaturedProducts.last}last_item{else}item{/if} {if $smarty.foreach.homeFeaturedProducts.iteration%$nbItemsPerLine == 3}last_item_of_line{elseif $smarty.foreach.homeFeaturedProducts.iteration%$nbItemsPerLine == 1}clear{/if} {if $smarty.foreach.homeFeaturedProducts.iteration > ($smarty.foreach.homeFeaturedProducts.total - ($smarty.foreach.homeFeaturedProducts.total % $nbItemsPerLine))}last_line{/if}">



кол-во строк 3;

кол-во продуктов в строке 3;

и чтобы последней,третьей, строке тоже присваивался класс, которому можно задать свойства..

Всем спасибо...

Share this post

Link to post
Share on other sites

Чтобы последний отличался с ходу не скажу.


чукча не читатель, чукча писатель?







равно TRUE, если текущая итерация {foreach} - последняя.

Share this post

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Create New...

Important Information

Cookies ensure the smooth running of our services. Using these, you accept the use of cookies. Learn More