Importing HTML Content
I can't seem to find a specific code example for what I need. I am writing code to import HTML documents into Sitefinity - it works except for the last piece of trying to use the SDK to add a content block widget to the page and fill it with the HTML content. My code is below - can someone point me in the right direction? This code doesn't add the content block to the page - much less the HTML content itself. Note - I get the page successfully. Thanks!
// Get the page
PageManager manager = PageManager.GetManager();
var page = manager.GetPageNodes().Where(p => p.Id == file.Id).SingleOrDefault();
// Create content block page control
ContentBlock aspxContent = new ContentBlock();
aspxContent.Html = file.AspxContent;
aspxContent.Visible = true;
aspxContent.ID = "ASPX" + file.Id.ToString();
PageControl aspxContentControl = manager.CreateControl<PageControl>(aspxContent, "AspxContent");
aspxContentControl.Caption = "Page Content";
// Add the control to the page
// Save the changes
Thank you for using Sitefinity.
You're not specifying a content placeholder to add the control to. Without this being specified the system has no idea where to put your control.
You need something like this: