delime Posted October 12, 2011 Share Posted October 12, 2011 Ребята помогите разобраться/дописать условие в 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; и чтобы последней,третьей, строке тоже присваивался класс, которому можно задать свойства.. Всем спасибо... Link to comment Share on other sites More sharing options...
Ronaldo Perez Posted October 12, 2011 Share Posted October 12, 2011 http://www.smarty.net/docsv2/ru/language.function.foreach.tpl аум Link to comment Share on other sites More sharing options...
delime Posted October 12, 2011 Author Share Posted October 12, 2011 Спасибо, попробую разобраться... Link to comment Share on other sites More sharing options...
Ronaldo Perez Posted October 15, 2011 Share Posted October 15, 2011 Чтобы последний отличался с ходу не скажу. чукча не читатель, чукча писатель? http://www.smarty.net/docsv2/ru/language.function.foreach.tpl#foreach.property.last .last Свойство last равно TRUE, если текущая итерация {foreach} - последняя. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now