Portal Engine
Version 3.x > Portal Engine > Setting DocumentPublishTo View modes: 
User avatar
Certified Developer v7
Certified  Developer v7
nliebmann - 4/16/2009 9:16:31 AM
   
Setting DocumentPublishTo
hi,

I'm trying to set the DocumentPublishTo and DocumentPublishFrom to calculated dates, when a new menu item (page) is being programmatically added to a node via the TreeNode api.

I see the the properties for from and to are read only ,as there is only a get and no set, yet this is accessible via the CMS desk.

I can achieve this with an ugly hack of directly accessing columns in the CMS_Document table, but want to know if there is a way through the treenode api, as i cannot find anything in the documentation.

thanks

User avatar
Kentico Developer
Kentico Developer
kentico_martind - 4/18/2009 10:42:17 AM
   
RE:Setting DocumentPublishTo
Hello,

You can use following sample code to set value for DocumentPublishFrom column (node is instance of TreeNode class):

node.SetValue("DocumentPublishFrom", value);

Best Regards,

Martin Dobsicek