Extend default widget designers

With Sitefinity CMS, you can override the default designer views, JSON, and JavaScript files by creating a file with the same name. This is suitable when you want to change the way your default designers look, but you do not want to create a new designer view for this purpose. For example, you want to brand them with your company’s logo.

In Sitefinity CMS, you follow a strict convention for resolving resources. Because of this, if in your SitefinityWebApp you place a project a file with the same name as the resource you want to override (view, JSON, or JavaScript,) your resource file will be used, instead of the default one.

In this scenario, there are some considerations to be taken into account. For example, if you need to add another client component in your view, it is not enough to create a view with the same name, because the default JSON and JavaScript files will be loaded. They do not contain the scripts required for your additional client component, therefore, your overridden view will not work as expected.

This means that if you want to add additional script dependencies, you must override the JSON file and place it in the same place as the view. For more information, see Extend custom designers with additional client logic.
If, in addition, you need custom client logic, you must also have to override the JavaScript file and place it in the folder, by convention.

This article describes the case in which you want to enrich your designer view. In case you want to remove components or scripts that you do not need, you must override the JSON or the JavaScript file. Otherwise, they will be loaded unnecessarily in your designer view.

This article demonstrates how to override the views. If you only need to change the priority of the overridden designer view, you only need to create the JSON file in the proper folder. If you need to change the client-side logic, you only need to create the JavaScript file in the proper folder. If, in your client logic, you need a dependency, such as an AngularJS module, you will also need to describe this dependency in your JSON file by overriding it.

Want to learn more?

Sign up for our free beginner training. Boost your credentials through advanced courses and certification.
Register for Sitefinity training and certification.

Was this article helpful?