Develop and extend
Overview
In Sitefinity CMS, you can easily build a page using drag-and-drop of widgets. These widgets and their configurations are stored in the database as a meta model. Sitefinity ASP.NET Renderer takes advantage of this model and consumes it via REST services, parses it, and constructs a page for the specific set of widgets on the page. It then renders the page in HTML and returns it to the user.
RestSDK
The ASP.NET Core Renderer version comes with a C# RESTSDK that can work with Sitefinity CMS content. You can use the REST SDK for both retrieving and creating content.
It is delivered in the Progress.Sitefinity.RestSdk
, which is automatically installed and referenced.
For more information, see REST SDK.
Widgets
The standard approach to extending Sitefinity CMS frontend is to write custom widgets or to override the logic of the built-in ones. The corresponding elements for widgets in ASP.NET Core are ViewComponents
. Thus, widgets that are available in the Sitefinity CMS Toolbox, correspond to the ViewComponents
classes in the ASP.NET Core application.
For more information, see Extend the built-in widgets and Custom widgets.
Layout files
The ASP.NET Core pages are based on templates that are stored in the Renderer application. The ASP.NET Core templates are MVC Layout files, stored on the file system. If a page is based on one of these layout files, the Renderer will be able to render the page.
To create a base layout for all of your pages, you can leverage the power of Layout in ASP.NET Core. The layout files that are located in the Renderer’s Views
/Shared
folder are scanned and displayed in the template selector when you create a new page.
NOTE: Every layout file must have a section named Scripts
.
Out-of-the-box Sitefinity ASP.NET Core Renderer comes with a blank template called Default that you can select the template selector. This layout file references Bootstrap5 CSS framework. The default Section widget templates also contain the Bootstrap5 grid system markup.
For more information, see Layout and Style.
Application file structure
When you create your widgets and layout files, you place them in folders under your project's root folder. You can also use a project template, provided in Sitefinity's GitHub repository.
For more information, see Application structure.
Styles
In most cases, your website requires uniform styling. Therefore, we recommend using minified styles. Reference them in your layout files and follow the good practices for working with styles. This way, the styles are applied to all widgets on your page. The default layout file that comes with Sitefinity ASP.NET Core Renderer references the Bootstrap 5 framework.
Scripts
You can reference your scripts on global level in the layout files or inside the widget views.
Client side development
Client-side development is performed in the same way as in any ASP.NET Core application. The developers are free to use preprocessors and build tools of their choice. Client-side development is not Sitefinity-related.
For more information, see Client-side development.
Limitations
- You cannot edit templates using Sitefinity ASP.NET Core Renderer.
- You cannot inherit templates.