Forums / Setup & design / Process matrix array / Comment26299
paul bolger
Wednesday 14 May 2008 5:18:15 am
Thanks Maxime
That looks a lot more like what I understand. "Learn PHP" is unfortunately still on my todo list...
As a matter of interest I managed to make the template work using the sequence array method too. I'd be interested to know if you think this is worse, or more inefficient, than your method. I might put both into the documentation as comments in the Matrix section - save myself a lot of time when I need to do this again!
{def $objects = $attribute.content.cells} <title>{$attribute.object.name}</title> <trackList> {foreach $objects as $object sequence array( 'title', 'location' , 'fallback' , 'image') as $element} {if eq( $element, 'title')} <track> {/if} {if eq( $element, 'fallback')} <meta rel='{$element}'>{$object}</meta> {else} <{$element}>{$object}</{$element}> {/if} {if eq( $element, 'location')} <meta rel='type'>flv</meta> {elseif eq( $element, 'image')} </track> {/if} {/foreach} </trackList>
Paul Bolger