asdqwerty Posted October 9, 2013 Share Posted October 9, 2013 (edited) Hi I've created a custom theme with bootstrap and a problem occured with the homeslider. I want the class "active" to only be printed on the first slide and I do not know how to accomplish this with smarty. Here is the code right now: {if isset($homeslider_slides)} <div id="homeslider" class="carousel slide"> <div class="carousel-inner"> {foreach from=$homeslider_slides item=slide} {if $slide.active} <div class="item active"> <img src="{$smarty.const._MODULE_DIR_}homeslider/images/{$slide.image|escape:'htmlall':'UTF-8'}" alt="{$slide.legend|escape:'htmlall':'UTF-8'}" height="{$homeslider.height|intval}" width="{$homeslider.width|intval}" /> </div> {/if} {/foreach} <a class="left carousel-control" href="#homeslider" data-slide="prev"> <span class="icon-prev"></span> </a> <a class="right carousel-control" href="#homeslider" data-slide="next"> <span class="icon-next"></span> </a> </div> </div> {/if} Any idea on how to do this? Regards Edited October 9, 2013 by vekia (see edit history) Link to comment Share on other sites More sharing options...
asdqwerty Posted October 9, 2013 Author Share Posted October 9, 2013 Fixed it with this: <div class="item{if $smarty.foreach.slide.first} active{/if}"> Link to comment Share on other sites More sharing options...
vekia Posted October 9, 2013 Share Posted October 9, 2013 thank you for posting your solution im going to mark this thread as [solved] in addition to what you said, can you also say what ps version you use? Link to comment Share on other sites More sharing options...
asdqwerty Posted November 18, 2013 Author Share Posted November 18, 2013 Sorry for the late answer, this is PS 1.5.5 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