Skip to content

Editing Templates

johnhenley edited this page May 8, 2025 · 10 revisions

(v8.x and prior)

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: image

(v9 and newer)

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.

Specify a unique file name suffix for your templates to use

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:

image

Determine which template file needs to be copied & customized

( 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.

image

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: image

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.

image

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. image

Template loading in action

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, image image

With a match, image image

This works across all templates. No more database table. No longer necessary to specifically set each template for each forum group and/or forum.

Clone this wiki locally