Sitefinity CMS comes with a set of built-in modules, which can be directly used in the pages you create. You can also create your own custom modules and use them side by side with the default ones.
Each Sitefinity CMS module must inherit from the ModuleBase class and override the Install method. In it, add the logic for the actions the module performs when getting added to a Sitefinity CMS site. For example, registering some configuration, creating backend pages, adding widgets and so on.
You can leverage the Sitefinity VSIX and CLI tools to get started with building custom modules. Both Sitefinity VSIX and Sitefinity CLI enable you to add a new custom module project with the necessary scaffolded module classes, containing inline guidance.
EXAMPLE: To create a general purpose module in Sitefinity CMS, with minimum implementation effort, refer to the sample Database diagnostic module. The module class contains inline documentation for each method used and can guide you into the purpose of each of them.
To facilitate modules decoupling, Sitefinity CMS provides an easy mechanism for installing modules automatically. This way, you can create custom modules, which are installed automatically upon Sitefinity CMS startup. For your module to be discovered and auto-installed at startup, you need to mark it with the SitefinityModuleAttribute assembly attribute.
While the website is initializing, Sitefinity CMS looks for assemblies in the /bin folder, containing modules marked with this attribute and installs them. The SitefinityModuleAttribute requires you to specify your module name, type, title, description, startup type, module ID, and resource class ID if applicable.
In addition to the full implementation of the Database diagnostic module, discussed above, below you can find below an example of a dummy Sitefinity module that you can use as a scaffolding for your custom implementations if you prefer to start from scratch:
Sign up for our free beginner training. Boost your credentials through advanced courses and certification. Register for Sitefinity training and certification.
To submit feedback, please update your cookie settings and allow the usage of Functional cookies.
Your feedback about this content is important