Im using the following Smarty code:
{foreach from=$entries key=i item=topic} {if $topic.topic_style == question}
Use index:
{foreach from=$entries key=i item=topic name=foo} {if $smarty.foreach.foo.index < 10} {if $topic.topic_style == question} {$topic.title} {/if} {/if} {/foreach}