Tuesday 22 August 2006 1:46:08 am
I am trying to get rid of {let} and {section} and use {def} and {foreach}. Would you please tell me what is wrong with code conversion? My code does not produce anything Original Code {let use_url_translation=ezini('URLTranslator','Translation')|eq('enabled')}
{section show=$search_result}
<table class="list" width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<th>{"Name"|i18n("design/standard/content/search")}</th>
<th width="1">{"Class"|i18n("design/standard/content/search")}</th>
</tr>
<tr>
{section name=SearchResult loop=$search_result show=$search_result sequence=array(bglight,bgdark)}
{node_view_gui view=search sequence=$:sequence use_url_translation=$use_url_translation content_node=$:item}
{delimiter modulo=1}
</tr>
<tr>
{/delimiter}
{section-else}
{/section}
</tr>
</table>
{/section}
{/let}
My Code {def use_url_translation=ezini('URLTranslator','Translation')|eq('enabled')}
{if $search_result}
<table class="list" width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<th>{"Name"|i18n("design/standard/content/search")}</th>
<th width="1">{"Class"|i18n("design/standard/content/search")}</th>
</tr>
<tr>
{foreach $search_result as $SearchResultIndex=>$SearchResult sequence=array(bglight,bgdark) as $seq}
{node_view_gui content_node=$SearchResultIndex.name|wash view=search use_url_translation=$use_url_translation }
{delimiter}
</tr>
<tr>
{/delimiter}
{/foreach}
</tr>
</table>
{/if}
{undef}
|