Jobs module: Create the module
The Jobs module registers all necessary components to work with job applications and creates the backend pages that provide an overview of submitted job applications.
To implement the module, perform the following:
- In Visual Studio, open the context menu of the solution and click Add » New Item...
- In the left pane, select Visual C# » Code.
- Click Class and in the Name input field, enter JobsModule.cs
- Open the JobsModule.cs file.
- Change the class definition to inherit
ContentModuleBase
.
- Define the module name.
- Add the properties.
- Override the Initialize method of the ContentModuleBase class.
In the method, you register the configuration class for the module and the backend service.
- Override the Install method of the ContentModuleBase class.
This method installs the module in Sitefinity CMS.
- In the InstallCustomVirtualPaths method, register the prefixes used by the LayoutTemplatePath properties of your frontend widgets.
- Implement the ContentModuleBase.
- To install the backend pages, add the
InstallPages
method.
- To install the widgets in the Sitefinity CMS toolbox, add the
InstallConfiguration
method.
EXAMPLE: For more information about the contents of the file, refer to class JobsModule.cs
from the downloaded sample project.
In this class, the JobsModule inherits from ContentModuleBase class - the default base class for content-based modules. The property public overrides Type[] Managers and returns the manager, which this module uses. The Initialize method is executed every time Sitefinity CMS starts. The method registers the JobsConfig configuration class - , the JobsResources resource class, which contains localized strings, and the backend service.InstallConfiguration registers the upload control in the Sitefinity CMS toolbox.
InstallPages creates the necessary backend pages using definitions. Definitions are the properties that a widget needs so that it is displayed in the user interface. First, you get the modules node. Then, you create a manager to get the jobs node. If the jobs node is not yet created, you create it. After the jobs node is created, you define the backend view.