deniss13 Posted September 19, 2015 Share Posted September 19, 2015 In this code: {if $infos|@count > 0} <!-- MODULE Block cmsinfo --> <div id="cmsinfo_block"> {foreach from=$infos item=info} <div class="col-xs-6" >{$info.text}</div> {/foreach} </div> I want to change col-xs-6 to col-xs-12 for the first child of the div, hot to do that? Link to comment Share on other sites More sharing options...
taydotech123 Posted September 19, 2015 Share Posted September 19, 2015 {assign var='counter' value=1} {foreach from=$infos item=info} {if $counter == 1} <div class="col-xs-12" >{$info.text}</div> {else} <div class="col-xs-6" >{$info.text}</div> {/if} {$counter++} {/foreach} Link to comment Share on other sites More sharing options...
razaro Posted September 19, 2015 Share Posted September 19, 2015 Check http://www.smarty.net/docs/en/language.function.foreach.tpl there is built in first property that you can use. There is also iteration and index and solution by taydotech123 also works. 1 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