Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
Hello,
I try to create umbraco node Programmatically like this
var author = new User("user name");var product = contentService.CreateContent(sender.Text, parentNodeId,"uBlogsyPost", userId.Id);product.SetValue("uBlogsyContentTitle", sender.Text);product.SetValue("uBlogsyContentBody", post);
now i want to set template like "TextTemplate" , is it possible? how..?
product.Template = "TextTemplate" ;
should set it.
you will need to save the content afterwards
i.e contentService.Save(product, 0, true); (user0 - should replace if you have one)
contentService.Save(product, 0, true);
sorry complety ignore me
it's
ITemplate template = ApplicationContext.Current.Services.FileService.GetTemplate("TextTemplate"); if (template != null) product.Template = template;
thanks for your quick reply...solved
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
Programmatically setting a template on node creation
Hello,
I try to create umbraco node Programmatically like this
now i want to set template like "TextTemplate" , is it possible? how..?
should set it.
you will need to save the content afterwards
i.e
contentService.Save(product, 0, true);
(user0 - should replace if you have one)sorry complety ignore me
it's
thanks for your quick reply...solved
is working on a reply...