Creating dynamic document Types when I save a Product in custom database.
Hi,
I m working on a Real Estate Website project using Umbraco 7.7.2 using peta pocco style to save properties in custom database. Where I am stuck at the moment is, whenever I create a property, I want a "content page" for it's detail information to be created dynamically based on an already existing document type in the Umbraco backoffice. so the editor won't have to create the detail content page manually.
I am trying to use Content Services but no luck so far. am I going in the wrong direction. below is the code snippet I am trying right now,
ContentType ct = new ContentType(contentType);
ContentService cs = (ContentService)ApplicationContext.Current.Services.ContentService;
UserService us = (UserService)ApplicationContext.Current.Services.UserService;
Int uid = us.GetByUsername("sahar").Id;
// Create the document
Content home = (Content)cs.GetById(1059);
Content c = (Content)cs.CreateContent(nodeName, home, ct.Alias, uid);
cs.Publish(c, uid);
return c.Id;
Creating dynamic document Types when I save a Product in custom database.
Hi,
I m working on a Real Estate Website project using Umbraco 7.7.2 using peta pocco style to save properties in custom database. Where I am stuck at the moment is, whenever I create a property, I want a "content page" for it's detail information to be created dynamically based on an already existing document type in the Umbraco backoffice. so the editor won't have to create the detail content page manually.
I am trying to use Content Services but no luck so far. am I going in the wrong direction. below is the code snippet I am trying right now,
Quick help will be appreciated a lot.
Thanks, Sahar
is working on a reply...