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 create 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.

Get started with Integration Hub | Sitefinity Cloud | Sitefinity SaaS

This free lesson teaches administrators, marketers, and other business professionals how to use the Integration hub service to create automated workflows between Sitefinity and other business systems.

Web Security for Sitefinity Administrators

This free lesson teaches administrators the basics about protecting yor Sitefinity instance and its sites from external threats. 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?