Code: Select all
{foreach from=$events key=key item=event}
<td valign="top">
{if !empty($event.categories)}
{foreach from=$event.categories item='cat_name'}
{$cat_name}<br/>
{/foreach}
{/if}
</td>
{/foreach}
Code: Select all
{foreach from=$events key=key item=event}
<td valign="top">
{if !empty($event.categories)}
{foreach from=$event.categories item='cat_name'}
{$cat_name}<br/>
{/foreach}
{/if}
</td>
{/foreach}
Code: Select all
{foreach from=$event.categories item='value' key=key}
{$key}<br/>
{/foreach}
the foreach $key prints the category name and the $value prints '1' because *I think* that the 1 is like a flag set when the category is true for an event.Array
(
[Category Name A] => 1
[Category Name B] => 1
)
Code: Select all
{* event categories *}
{if !empty($event.categories)}
{assign var='event_categories' value=$event.categories|@array_keys}
{', '|implode:$event_categories}
{/if}
{* end event categories *}