Portal Engine Questions on portal engine and web parts.
Version 5.x > Portal Engine > Metadata determine if inherited View modes: 
User avatar
Member
Member
adegiamb - 5/20/2011 12:23:39 PM
   
Metadata determine if inherited
In the CMS Desk if you go to Properties -> Metadata of a document it has the ability to inherit Page Title, Description and keywords.

Using the API how can I determine if the field value is inherited or not.

thanks

ADG

User avatar
Member
Member
kentico_michal - 5/23/2011 6:23:57 AM
   
RE:Metadata determine if inherited
Hello,

Regrettably, Kentico CMS does not provide any property to determine if Metadata fields are inherited.
However, you can determine the inheritance based on whether the particular field is null or not. If it is null, it means that the value is inherited from the parent node:



if (node.GetValue("DocumentPageTitle") != null)
{
// value is not inherited
}
else
{
// value is inherited and you can access it using node.GetInheritedValue method
}


where node is a TreeNode object.

If you need more information I would like to point you to API reference.


Best regards,
Michal Legen

User avatar
Member
Member
adegiamb - 5/23/2011 2:59:25 PM
   
RE:Metadata determine if inherited
Thanks that did the trick.