AnsweredAssumed Answered

Can't get presentation template to work

Question asked by davidd on Jul 10, 2008
I am running Alfresco 2.9 community edition.

I have successfully added a custom aspect to space,
which adds a couple of custom metadata fields to the content (e.g. a document number):

<property name="custom:DocumentNumber">
<title>Document Number</title>
<type>d:int</type>
</property>

This seems to work fine and I can add document numbers to content and see them in the Details display.

However I am trying to get a Presentation Template to display the document number in a custom view:

  <#list space.childrenByXPath[".//*[subtypeOf('cm:content')]"] as child>
         <tr>
            <td><a href="/alfresco${child.url}" target="new"><img src="/alfresco${child.icon16}" border=0></a></td>
            <td>${child.properties["custom:DocumentNumber"]?c}</td>
            <td>${child.properties["cm:versionLabel"]}</td>
            <td><a href="/alfresco${child.url}" target="new">${child.properties.title}</a></td>
            <td>${child.properties["cm:created"]?datetime}</td>
            <td>${child.properties["cm:modified"]?datetime}</td>

The ${child.properties["custom:DocumentNumber"]?c} doesn't seem to work, though,
just gives
"Error during processing of the template 'child.properties["cm:DocumentNumber"] is undefined.'. Please contact your system administrator."

Any suggestions (it seems to match the syntax suggested in the Packt Alfresco book….)

Outcomes