ASPX templates
Version 5.x > ASPX templates > How to publish node in CustomTreeNodeHandler OnAfterInsert View modes: 
User avatar
Member
Member
ricardo.fiel - 1/22/2010 6:00:36 AM
   
How to publish node in CustomTreeNodeHandler OnAfterInsert
Hi,

I couldn't find an API section on the forums, so I'm posting here. Sorry.

How can one publish a newly created node inside CustomTreeNodeHandler's OnAfterInsert?
What I'm trying to achieve is creating a series of nodes and have them published when created.

Thanks,
Ricardo

User avatar
Kentico Consulting
Kentico Consulting
kentico_borisp - 1/22/2010 6:46:29 AM
   
RE:How to publish node in CustomTreeNodeHandler OnAfterInsert
Hello,

I assume, you are trying to create forum nodes. Please take a look into the file ~\CMSModules\Forums\Controls\PostTree.ascx.cs where the code for creating nodes is located around line 352 in the CreateNode(..) method. You can create a similar functionality by this example.

Best regards,
Boris Pocatko

User avatar
Member
Member
ricardo.fiel - 1/26/2010 7:39:35 AM
   
RE:How to publish node in CustomTreeNodeHandler OnAfterInsert
Hi, I ended up setting DocumentPublishFrom to the correct value and works.

Thanks.

User avatar
Kentico Consulting
Kentico Consulting
kentico_borisp - 1/26/2010 9:13:59 AM
   
RE:How to publish node in CustomTreeNodeHandler OnAfterInsert
Hello,

Thank you for the update.

Have a nice day.

Best regards,
Boris Pocatko