Modify default templates used in all dynamic content widgets

Sitefinity CMS enables you to change the appearance of dynamic content MVC widgets through their comprehensive set of properties. In some cases, you need to further customize the look of MVC built-in widgets. You may want to implement some custom logic on the template, for example, a dropdown menu.

Use the following procedure to customize the view of the dynamic content MVC widget:

  1. Open the Sitefinity CMS GitHub repository repository and navigate to Telerik.Sitefinity.Frontend.DynamicContent » WidgetTemplates » ContainerTemplates.
  2. Depending on whether you want to customize the List or Detail views, copy one of the following files:
    • List.<template name>.cshtml
      The controller passes the @model Telerik.Sitefinity.Frontend.DynamicContent.Mvc.Models.DynamicContentListViewModel to the view 
    • Detail.<template name>.cshtml
    • The controller passes the @model Telerik.Sitefinity.Frontend.Mvc.Models.ContentDetailsViewModel to the view 
  3. Open your project in Visual Studio.
  4. Under SitefinityWebApp, create a new folder and name it WidgetTemplates.
  5. Inside folder WidgetTemplates, create a new folder and name it ContainerTemplates.
  6. Inside folder ContainerTemplates,  paste the view copied in Step 2.
  7. Open the file and edit it in the following way:

    NOTE: The new template is available only for new dynamic content types.

  8. If you want to apply the template to existing dynamic content types, regenerate their widget templates.
    To do this, perform the following:
    1. Click Administration » Module builder.
    2. Open the module and then open the dynamic content type.
    3. Click the Finish button and in the dialog box, select Update widget templates as well.

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.

Tags

Was this article helpful?