4

i have a .net user control to add some opinions nodes to umbraco content tree.In umbraco i have a Opinion document type and content page.I need to show this usercontrol in the page,until there i can do it,but i have to add an "Opinion Node" to umbraco content tree.How can i do that ? There is no any document for this,ive been searching it for 2 days.Thanks in advance

1
  • Can you reword your question as it is a little unclear what you need. Do you want to know how to add a node into the content tree programmatically? Commented Feb 24, 2012 at 12:10

1 Answer 1

9
Document d = Document.MakeNew("New node name", DocumentType.GetByAlias("myDoctype"), User.GetCurrent(), parentNodeId);

Replace the parameters with appropriate values to create a new node called "New node name" of type "MyDoctype". If doing this through front-end (public-accessible) code, use the admin user by replacing User.GetCurrent() with new User(-1).

Sign up to request clarification or add additional context in comments.

2 Comments

Thank you,before your answer i found the same answer but thank you so much
Also adding: d.Publish(author); umbraco.library.UpdateDocumentCache(d.Id); Will save and publish

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.