Portal Engine Questions on portal engine and web parts.
Version 6.x > Portal Engine > How to access the 'Show in navigation' Property of a document programatically View modes: 
User avatar
Member
Member
ronald.hariyanto-rapp.com - 6/15/2012 3:19:36 AM
   
How to access the 'Show in navigation' Property of a document programatically
Hi everyone,

How can we access the 'Show in navigation' Property of a document programatically?

Thank you

User avatar
Kentico Support
Kentico Support
kentico_janh - 6/15/2012 4:02:08 AM
   
RE:How to access the 'Show in navigation' Property of a document programatically
Hello,

All you need to do is to get the node you want that property set for. Here is an example for a current node:

CMS.TreeEngine.TreeNode tn = TreeHelper.SelectSingleNode(CMSContext.CurrentDocument.NodeID);
tn.SetValue("DocumentMenuItemHideInNavigation", false);
tn.Update();


Best regards,
Jan Hermann