Create a page with a Blog posts widget

To create a standard page with a Blog posts widget added on it, perform the following:

  1. Create a standard Sitefinity CMS page.
    Perform procedure For developers: Create a page with the native API.
  2. Edit the page to add the Blog posts widget.
    You do this using the EditPage method of the PageManager in the following way:
    1. SuppressSecurityChecks of the page provider.
    2. Get the page node by ID.
    3. Call the EditPage method.
  3. Create a new Blog post widget and add it to the page.
    Blog posts widget is represented by the BlogPostView class.
    Perform the following:
    1. Create an object of the BlogPostView class.
    2. Add the Blog posts widget control to the page draft and set its properties.
  4. Publish page draft and save changes
    Use the PublishPageDraft method of PageManager and call SaveChanges to finalize the creation of the page.

EXAMPLE: In the following code example, the CreatePageWithBlogPostWidget method creates a new standard page and adds the Blog posts widget on it:

Increase your Sitefinity skills by signing up for our free trainings. Get Sitefinity-certified at Progress Education Community to boost your credentials.

Web Security for Sitefinity Administrators

The free standalone Web Security lesson teaches administrators how to protect your websites and Sitefinity instance from external threats. Learn to configure HTTPS, SSL, allow lists for trusted sites, and cookie security, among others.

Foundations of Sitefinity ASP.NET Core Development

The free on-demand video course teaches developers how to use Sitefinity .NET Core and leverage its decoupled architecture and new way of coding against the platform.

Was this article helpful?