Depending on the amount of crumbs I have either:
[trail] => Array
(
[crumb] => Array
(
[url] => /app/system
[label] => System
)
[trail] => Array
(
[crumb] => Array
(
[0] => Array
(
[url] => /app/system
[label] => Sytem
)
[1] => Array
(
[url] => /app/system/edit
[label] => System Edit
)
)
)
In smarty I have:
{if $trail.crumb}
<ul class="breadcrumbs">
{foreach $trail.crumb as $crum}
<li itemscope itemtype="http://data-vocabulary.org/Breadcrumb">
<a href="{$crum.url}" itemprop="url" title="{$crum.label}"><span itemprop="title">{$crum.label|truncate:20}</span></a>
</li>
{/foreach}
</ul>
{/if}
In the first example this shows:
Fatal error: Cannot use string offset as an array
Is there a way to do this without duplicating the HTML?