The system stores forum layouts in <web project>\CMS\CMSModules\Forums\Controls\Layouts. By default, the folder contains three sub-folders.
The Flat and Tree folders contain controls for the corresponding default layouts.
To create a custom layout:
- Add a new folder in the Layouts directory or use the default Custom folder (the system uses the name of the folder as the name of the custom layout).
Implement all controls included in the Flat and Tree layouts within the given folder, with any required custom content or logic.
All of the controls must inherit from the CMS.Forums.Web.UI.ForumViewer class and have exactly the same names as in the Flat and Tree layout folders.
- Open the Form controls application in Kentico.
- Edit the Forum layout selector form control.
- Switch to the Properties tab and select the Options field.
Add an item matching the name of your custom layout folder into the field's Default value. For example:
flat;Flat tree;Tree custom;Custom
- Click Save.
Once implemented, you can assign the custom layout to your website's forums. The layout automatically appears as an option in the Forum layout property of Forum group and Forum (Single forum - General) web parts.
Was this page helpful?