Get document NodeRef in field template
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-10-2014 05:34 AM
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!
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!
Labels:
- Labels:
-
Archive
2 REPLIES 2

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-10-2014 08:32 AM
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:
So I guess
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
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-11-2014 03:40 AM
Scouil, thanks a lot Bro, it works

