Create a page with a Blog posts widget
To create a standard page with a Blog posts widget added on it, perform the following:
- Create a standard Sitefinity CMS page.
Perform procedure For developers: Create a page with the native API.
- Edit the page to add the Blog posts widget.
You do this using the
EditPage method of the
PageManager in the following way:
SuppressSecurityChecks of the page provider.
- Get the page node by ID.
- Call the
- Create a new Blog post widget and add it to the page.
Blog posts widget is represented by the
Perform the following:
- Create an object of the
- Add the Blog posts widget control to the page draft and set its properties.
- Publish page draft and save changes
PublishPageDraft method of
PageManager and call
SaveChanges to finalize the creation of the page.
EXAMPLE: In the following code example, the
CreatePageWithBlogPostWidget method create a new standard page and adds the Blog posts widget on it: