Forums / General / variable variables / Comment33354

Author Topic

Patrick Kaiser

Tuesday 07 August 2007 12:32:37 pm

Comment33354

At least for my original problem I found the solution in between.
Given the case you want to access attributes that follow a certain naming convention (ie. attribute_1, attribute_2, attribute_3, etc) you could do the following:

{def $attribute_pre='attribute_' $tmp=''}
{for 0 to 4 as $number}
  {set $tmp=concat( $attribute_pre, $number )}
  {$node.data_map[$tmp].content}
{/for}


Best regards,

Patrick