Smarty Forum Index Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon.

i=i+1

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> General
View previous topic :: View next topic  
Author Message
alouty
Smarty Rookie


Joined: 07 Sep 2012
Posts: 8

PostPosted: Wed Oct 17, 2012 1:30 pm    Post subject: i=i+1 Reply with quote

i=0. I would like to make tab1, tab2,tab3, and so on inside foreach and also if i=1 then echo class="active" at first <li>. How to make it?

{elseif $complexField == "KeySkills"}
<ul>
{foreach from=$complexElements key="complexElementKey" item="complexElementItem"}
{foreach from=$form_fields item=form_field}
{if $form_field.caption == "Key personal skill"}
<li (if i=1 then echo class="active")><a href="#tab1" data-toggle="tab">{display property=$form_field.id complexParent=$complexField complexStep=$complexElementKey}</a></li>
{/if}
{/foreach}
{/foreach}
</ul>
<div class="tab-content" style="min-height:470px;">
{foreach from=$complexElements key="complexElementKey" item="complexElementItem"}

{if $form_field.caption == "Percentaged Key Skill" || $form_field.caption == "Skill Detail"}
<div class="tab-pane fade active in" id="tab1">
<div class="item_top">
<p> {display property=$form_fields.SkillDetail.id complexParent=$complexField complexStep=$complexElementKey} </p>
<div class="donutchart2" data-percent="{display property=$form_fields.PercentKeySkill.id complexParent=$complexField complexStep=$complexElementKey}"></div>
</div>
</div>
{/if}

{/foreach}
</div>
Back to top
View user's profile Send private message
alouty
Smarty Rookie


Joined: 07 Sep 2012
Posts: 8

PostPosted: Thu Oct 18, 2012 1:19 pm    Post subject: Reply with quote

complexElementKey is 1,2,3...
Back to top
View user's profile Send private message
U.Tews
Administrator


Joined: 22 Nov 2006
Posts: 5068
Location: Hamburg / Germany

PostPosted: Thu Oct 18, 2012 5:25 pm    Post subject: Reply with quote

Maybe you are looking for something like this
Code:
<li {if $complexElementKey ==1}class="active{/if}><a href="#tab1" data-toggle="tab">{display property=$form_field.id complexParent=$complexField complexStep=$complexElementKey}</a></li>
Back to top
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> General All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP