Add and remove widgets from pages

Sitefinity CMS enables you to add and remove controls from a page through the Pages API.

When adding a control to page, you perform the following steps:

  1. Get the page node or data.
    When adding control to page, you first must get the page node or data. For more information about finding a specific page node and data, see For developers: Query pages.
  2. Get the temp draft of the page.
    You must add the controls to the temp draft of the page.
  3. Create draft control.
    To create the draft control, you use the page manager. To duplicate the control in the UI, you must set the ID property of the original control. For more information, see For developers: Generate unique control Id.
    When creating the draft control, we recommend to set the following properties:
    • Caption
      The interface label for the control.
    • SiblingId
      The preceding control Id. You must set this property for correct order of the controls in the page.
  4. Set default permissions for the draft control.
    You must set the default permissions for the draft control.
  5. Add the control.
    After you set the properties and permissions, you add the control to the temp draft of the page.
  6. Get master version of the page.
    After you add the control to the page, you must check in the page to get the master version.
  7. Publish the page.
    To publish the page, you use the workflow manager.

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?

Next article

Widget designers