Portal Engine Questions on portal engine and web parts.
Version 5.x > Portal Engine > Create a Document Type Field which is the Document's Parent Node Name? View modes: 
User avatar
Member
Member
PeterPC - 11/2/2011 12:10:36 PM
   
Create a Document Type Field which is the Document's Parent Node Name?
Hi,

Is it possible to create a field for a document type that is always equal to the value of that document's parent node? I've tried using a macro in the default value, which does not work.

Thanks
Pete

User avatar
Kentico Support
Kentico Support
kentico_zdenekc - 11/16/2011 5:03:55 AM
   
RE:Create a Document Type Field which is the Document's Parent Node Name?
Hello Pete,

Using CurrentDocumentParent macro selector could be useful for some cases, however for this aim, you will generally need to use Custom TreeNode handler.
Please see http://devnet.kentico.com/docs/5_5R2/devguide/treenode_handler.htm

In OnBeforeSave(), you can get the parent node field value and store it in your document field.

Regards,
Zdenek