cancel
Showing results for 
Search instead for 
Did you mean: 

Accessing custom Properties in Freemarker Templates

aswini
Champ in-the-making
Champ in-the-making
Hi,

Could someone provide help on how to access custom aspects in FTL?

For eg: Javascript:
<table cellpadding=2 border=1 style="BORDER: none;" frame="border" width=700 height=50>
    <tr>
        <th><b>status</b></th>
    </tr>
        <#list space.childrenByLuceneSearch[".//*[subtypeOf('cm:content')"] as child>
           <tr>                      
                            <td>
                               <#list workflow.assignedTasks as t>
                                ${t.properties["My:status"]}
                                </#list>
                            </td>
           </tr>
        </#list>
</table>

And my customModel has:

<aspects>
        <aspect name="My:status">
            <title>Status</title>
            <properties>
                <property name="My:status">
                    <title>Status</title>
                    <type>d:text</type>
                    <default>Draft</default>
                </property>
            </properties>
        </aspect>
    </aspects>

But when I apply the Presentation Template FTL - it says {t.properties["My:status"]} is undefined!!!!

Help required for correcting this…

Thanks

Aswini
1 REPLY 1

aswini
Champ in-the-making
Champ in-the-making
Well, I found my mistake and solved the mystery.

For reference, it needs to be accessed as:
                            <td>${child.properties["My:status"]?string}
                            </td>

Thanks
Aswini