Enable inline editing in widgets

By default, MVC widgets in Sitefinity CMS support the inline editing. You can also enable inline editing for custom widgets. For more information, see Implement inline editing for custom modules.

In addition to the default functionality, Sitefinity CMS allows you to enable inline editing using the InlineEditingAttributes and InlineEditingFieldAttributes helpers. This way, Sitefinity CMS automatically generates the required attributes, so you can have a cleaner markup.

To enable inline editing in MVC views, perform the following:

  1. Add InlineEditingAttributes to your view.
    To this methods, you must provide providerName, type, and Id of the item that you want to be inline editable.
  2. To enable the editing of particular field, add the InlineEditingFieldAttributes helper to the html element.
    When InlineEditingFieldAttributes are presented to any html element, the entire text content becomes editable.
  3. Provide the following parameters to InlineEditingFieldAttributes:
    1. propertyName
      The name of the property that you want to be editable.
    2. fieldType
      This is the type of field that you want to be editable.
      For example “ShortText”,  “LongText”, “DateTime”, “FlatTaxon”, “HierarchicalTaxon”, “ChoicesCheckBoxes”, “ChoicesRadioButtons”, “ChoicesDropDown”, “YesNo”.

Use the following examples:

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?