cancel
Showing results for 
Search instead for 
Did you mean: 

Repeating properties in Freemarker

kbonnet
Champ in-the-making
Champ in-the-making
Hi all,

We have a model with a repeating property (<multiple>true</multiple>), but i can't find a way to access the values via freemarker. Does anyone know how to do this?

Thanks a lot in advance!

Kind regards,

Koen Bonnet
2 REPLIES 2

jbarmash
Champ in-the-making
Champ in-the-making
Have you tried treatig it as a list and iterating through it?   I believe that should work.   You can check if a property is a multiple property by using ?is_enumerable

 <#if mydocument.properties[prop_name]?exists>
        <#– If it is a collection, enumerate it –>
       <#if mydocument.properties[prop_name ]?is_enumerable>
         <#list mydocument.properties[prop_name] as cat>
                        your code here…
            </#list>
et, etc.

http://wiki.alfresco.com/wiki/FreeMarker_Template_Cookbook

kbonnet
Champ in-the-making
Champ in-the-making
Damn, i tried something similar to this, but this did the trick! Dix pointes for you! Smiley Happy

Thanks a lot!

Koen