cancel
Showing results for 
Search instead for 
Did you mean: 

Get document NodeRef in field template

dreambitc
Champ in-the-making
Champ in-the-making
Hi all!

I have a custom type and a custom form to display nodes of this type on document-details page. I've written custom field template to display the property
and my question is how can i get NodeRef of the current node in a field template?

The first thing that comes to mind is parse url.args and get itemId(nodeRef), but i think there is a better way.

Have any ideas?

Thanks!
2 REPLIES 2

scouil
Star Contributor
Star Contributor
I think your approach would work if you edit the properties from the document details page, but I don't think it would from the document library page with the actions in the right of the document.

I dug through the Alfresco code and I can see the picker.inc.ftl template using:
<#if form.mode == "edit" && args.itemId??>currentItem: "${args.itemId?js_string}",</#if>


So I guess
args.itemId
might be what you need

dreambitc
Champ in-the-making
Champ in-the-making
Scouil, thanks a lot Bro, it works Smiley Happy