|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
alouty Smarty Rookie
Joined: 07 Sep 2012 Posts: 8
|
Posted: Wed Oct 17, 2012 1:30 pm Post subject: i=i+1 |
|
|
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 |
|
alouty Smarty Rookie
Joined: 07 Sep 2012 Posts: 8
|
Posted: Thu Oct 18, 2012 1:19 pm Post subject: |
|
|
complexElementKey is 1,2,3... |
|
Back to top |
|
U.Tews Administrator
Joined: 22 Nov 2006 Posts: 5068 Location: Hamburg / Germany
|
Posted: Thu Oct 18, 2012 5:25 pm Post subject: |
|
|
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 |
|
|
|
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
|