Dynamic modules
Overview
You create a dynamic module when the built-in Sitefinity CMS modules do not suit your needs. A module must have at least one content type. You create this type when you create the module. A module with one type can be, for example, an FAQ module, whose content type can be FAQs and FAQs can have two fields – Question and Answer. You can also have more than one content type in one module and you can have a hierarchy of the content types. For example, the Forums module has Forums and Threads content types, and Thread is a child of a Forum.
You first create the dynamic module and its first content type, then you activate the module and you can create more content types.
NOTE: If you are using Sitefinity CMS to manage multiple sites, if you create a module with the Module builder after you create a site, it is not automatically activated for this site. If you want to use it, you must manually activate it. For more information, see Edit sites and set site permissions » Configuring the modules of a site.
NOTE: Build-in and dynamic modules can be in one language – the backend language, but content items of dynamic modules can be multilingual.
Create a dynamic module
- In Sitefinity CMS backend, navigate to Administration » Module builder.
The Modules page lists the existing modules.
- Click Create a module.
The Create a module page opens.
- In the Name input field, enter the name of the module.
For example, FAQ.
- In the Description input field, you can enter a description of the module.
The description is displayed in the backend, in the list of modules on the Module Builder page.
- Click Continue.
- In the next step, the system takes you to create the first dynamic content type of the new module.
For more information, see Dynamic content types » Create a dynamic content type.
- To activate the module, click Activate this module.
For more information, see Activate and deactivate dynamic modules below.
RESULT: When you activate a module, the module appears under the Content tab, together with all of its first-level content types, and you can use it to create dynamic content items. Sitefinity CMS also adds a new widget group for each module and one widget for each content type. You use this widget to display the content items created with this module.
IMPORTANT: If you are working in a multisite environment, enable the module for each site where you want to use it. For more information, see Edit site properties and configure site modules » Configure the modules of a site.
Activate and deactivate dynamic modules
To use a module, it must be active. If you have created a module that does not appear under the Content tab, it means that you have not activated the module.
To activate or deactivate a module, perform the following:
- In Sitefinity CMS backend, navigate to Administration » Module builder.
- Perform one of the following:
- Click the Actions link of the module that you want to activate and click Activate or Deactivate respectively.
- Click the module you want to activate and then click Activate this module or Deactivate this module respectively.
When you activate a module, the module appears under the Content tab, together with all of its first level content types – you can use it to create dynamic content items. Sitefinity CMS also adds a new widget group for each module and adds one widget for each content type. You use this widget to display the content items created with this module.
When you deactivate the module, it is removed from the Content tab and from the widgets toolbox.
Modify the backend screens of a dynamic module
Use this procedure to add or remove fields, and to change the screens, which the module uses in the backend.
You can:
- Choose what information is displayed for the items by changing the columns of the list of all items.
- Configure how the form for creating dynamic content items looks like.
- Reorder and group fields.
Choose which columns to display
To change the columns displayed on the page of the module, perform the following:
- In Sitefinity CMS backend, navigate to Administration » Module builder.
- Click the module whose screen you want to change.
- Click Backend screen tweaks.
The Backend screen tweaks: <your module name> screen appears.
For each created content type, you have a section to edit its grid and item creation form.
- Click Add / remove columns in the table (grid) of the respective content type.
The Edit the columns for listing screen appears.
Under Existing columns, the system displays all columns of the table containing the dynamic content items.
Under Drag columns, the system displays a list of all available columns.
- To add columns in the grid, drag them from the Drag columns pane and drop them under Existing columns.
Columns that appear inactive are already added. Columns that appear active can be dragged under Existing columns.
- To delete currently displayed columns, click .
The Title, Actions, and Publication date columns cannot be deleted.
- Toreorder columns, drag them.
- When you are finished, click Save changes.
Change the form for creating and editing dynamic content items
Perform the following:
- Click Administration » Module builder.
- Click the module whose screen you want to change.
- Click Backend screen tweaks.
The Backend screen tweaks: <your module name> screen appears.
For each created content type, you have a section to edit its grid and item creation form.
- Click Reorder fields of the respective content type.
A form displaying all visible fields and section headings appears.
- You can reorder the fields of the form using drag and drop.
- You can group fields in sections by putting them under a section title.
- When you are finished, click Save changes in the toolbar.
RESULT: The form that you have configured will appear when a dynamic content item is created.
Import and export a dynamic module
Use this procedure to export or import the structure of the module, or to export content items created with this module.
Export the structure of the dynamic module
You can export the structure and the settings of the module you have created. This way you can upload it to another project. The settings and the structure are exported to a .zip
file.
Perform the following:
- In Sitefinity CMS backend, navigate to Administration » Module builder.
- Click the Actions link of the module you want to export.
- In the dropdown box, click Export structure.
- Click Export and save the
.zip
file on your computer.
You can then use this .zip
file to import the module in another project.
NOTE: No content created with this module is exported. To do this, see the procedure below.
Import a dynamic module in Sitefinity CMS
You can import a dynamic module from a .zip
file, which you can then activate and use in Sitefinity.
Perform the following:
- In Sitefinity CMS backend, navigate to Administration » Module builder.
- In the toolbar, click Import a module button.
- Click Select a file and browse your computer to find the
.zip
file of the module you want to import.
- Click Upload.
-
If you are importing a module that already exists, the Update dialog appears, explaining the changes which will be done to the existing module.
If you want to continue the procedure, click Update.
RESULT: The module is uploaded in status Inactive. To use it, you must activate it using procedure Activate and deactivate a dynamic module above.
Export content items created with the dynamic module
You can export the content items that are created with a dynamic module. The items are exported in an Excel file. Only Published items are exported to the file. The file contains the URL of the content item, its publication date, and the values of all fields of the content item. For example, if the content item contains an image, the URL of the image is exported, if the item contains text, entered with the text editor, the HTML of the text editor is exported.
To export dynamic content items, perform the following:
- In Sitefinity CMS backend, navigate to Administration » Module Builder.
- Click the Actions link of the module you want to export.
- In the dropdown box, click Export content.
The Export module content dialog appears.
- Select the data source where you want export data from.
- To save the content as an Excel file, click Export.
Edit and delete a module
Change the description of a module
To change the description of a module, perform the following:
- Click Administration » Module builder.
- Click the module whose name or description you want to change.
- Click Name and description.
- Enter the new description and click Save.
Delete a module
IMPORTANT: If you delete a module, you cannot use this module or its content items anymore.
To delete a module, perform the following:
- In the main menu, click Administration » Module builder.
- Click the Actions link of the module you want to delete and click Delete.
- Confirm the deletion.
The dynamic module, the module widget, and all content items created with the module are deleted.
: If you want to delete a module, but use it later, you can export, delete, and import later. For more information, see the procedure Import and export a dynamic module above.