-
Notifications
You must be signed in to change notification settings - Fork 22
Editing Templates
Starting in version 8, templates are stored in files rather than in the database. Templates can be edited from either the control panel, or by editing the template file specified for each template:
In prior versions, when you wanted to customize a template used in the Forums module, you would copy the existing template (in the control panel) and change it. For example, you might want to put some text on a moderated forum’s “topics view” page, so you create a new template.
In V9, this changes. You don’t assign individual templates anymore.
First, you specify an (optional) string as a file name suffix for desired forums or groups. In this example, I want to have two versions of a particular template; one for moderated forums and one for non-moderated forums. Since most of my forums are non-moderated, I will use the "standard" templates for those, but for the moderated forums, I need to override the "standard" templates with a file name suffix:
( Note: template files are in \DesktopModules\ActiveForums....)
The templates
folder under your selected theme probably only includes templates that have been customized for that theme.
There are many more templates shipped with the Forums module, so you might have to go to this folder to get the file that you want to customize and copy:
Copy the template file and rename to match the new filename suffix you entered above, and then make your edits directly on the file (using the editor of your choice):
Here I've copied the "standard" TopicsView.ascx
from my theme, and renamed the copy to be TopicsView-Moderated.ascx
.
Once you've saved your customized template, it will then be used.
If you are working on customizing templates, make sure you turn off template caching, and turn it back on later.
If there’s a matching file, it will get used; if not, it will use the default (for your theme, or if not part of your theme, it will use the module’s defaults)
Without a match,
With a match,
This works across all templates. No more database table. No longer necessary to specifically set each template for each forum group and/or forum.
This module is the official forums module for DNN and is used on the official DNN CMS Community website.
- Forums
- Email Notifications
- Polls
- Tags
- Categories
- Attachments
- Setting Up Development Environment
- Implementing Database Changes
- Release Testing
- Release Packaging
- Theme Packaging
- Database Models
- Database model version 8.2
- Previous Versions
- Dependencies