title: Smarty how to get a first index from foreach?
body: <p>Construction is this:</p>
  
  <pre><code>&lt;!-- projects list --&gt;
              {if !empty($userObjects)}
                  &lt;select id="projects-list" tabindex="1" name="project"&gt;
                      {if !isset($selected)}&lt;option value="0"&gt;Choose project&lt;/option&gt;{/if}
                  {foreach from=$userObjects item=v}
                      &lt;option value="{$v.Id}" {if $selected==$v.Id}selected="selected"{/if} }&gt;{$v.Name}
  
                          {* if it's 1st element *}
                          {if $smarty.foreach.v.index == 0}
                              {if isset($limit)}&lt;br /&gt;&lt;span id="projlimit"&gt;{$limit}&lt;/span&gt; {$currency-&gt;sign}{/if}
                          {/if}
  
                      &lt;/option&gt;
                  {/foreach}
                  &lt;/select&gt;
  </code></pre>
  
  <p>as you can see I did </p>
  
  <pre><code>{if $smarty.foreach.v.index == 0}
  </code></pre>
  
  <p>but it's going wrong. In this case all the <code>options</code> elemets has a $limit value. How to make it good? I need only first one.</p>