Magnolia 4.5 reached end of life on June 30, 2016. This branch is no longer supported, see End-of-life policy.
The Forum module allows you to add a discussion forum to your site. The module includes all resources necessary to manage forums, threads and messages in Magnolia.
Forums are managed in the AdminCentral in Forums and components are used to render forum content on pages. You can choose where the components should be placed and integrate them into content pages, deciding how each page relates to other pages. Data is stored in the JCR. The forum can be used independently or with the .
Magnolia Community Forums are powered by this module.
Forum is a community module and typically already installed. Go to Magnolia Store > Installed modules in AdminCentral to check. To install the module individually, see the general module installation instructions.
See the general module uninstalling instructions and advice.
The Forum module is ready to use and configured in
modules/forum. In the
/config node you can set options applicable to all forums. These properties are supported by the
createRolesForNewForums: Creates a user role for each forum. Default:
displayedCharactersInForumTree: Number of characters displayed in Content column in Forums. Messages are displayed in this column. Default:
messageNamePattern: Date pattern used to generate message node names. Default:
messagesPerPage: Maximum number of messages per page. Default:
repository: Workspace used to store forum data. Default:
showingUnvalidatedMessages: Whether new messages display immediately or after moderation. Default:
The module includes a number of custom commands that execute the actions in Forums. Commands are configured in
Forums allows you to create and moderate forums. Forum content is user generated and your forums should ideally be created and moderated on the public instance. You can activate forums if you prefer to work initially on the author instance. See Best practice for creating forums for more.
There are two work areas:
To create a forum:
Once a forum has been created you can add threads and edit, delete, lock, activate and deactivate forums and threads.
Once you have created a forum you can create any number of threads to get things started. The components allow users to create new threads and post messages on pages.
To create a thread:
Threads require at least one message. Messages are also useful to get the conversation going. When you create a thread, a message child node is created automatically. Select it and click Edit to enter message content.
The forum content displays as follows:
Once a thread has been created you can edit, delete, lock, activate and deactivate it.
The forum components components provided by the module are not available in the STK by default. You can download configurations.zip that includes all configuration examples used in this document. The zip includes the
stkForum page template,
stkForumLoginForm component template and script, and the template availability configuration. Import these configuration to replicate the examples.
Forums typically require four pages.
Here's an example page structure at
To function correctly the
threadView components need to be linked internally. Fields are available in the dialogs for this purpose. Linking is done by linking to the page on which the target component resides.
forumListlinks to the page on which the
threadListlinks to the pages on which the
threadView, and optionally the
threadNew, components reside.
threadNewlinks to the page on which the
Here's the content we added in Forums rendered on the
demo-features/modules/forum page and subpages.
The forum components have their own navigation. User navigation determines which forum threads are displayed on the page. The links that render automatically in the components point to the appropriate target content. For this reason it is best to hide all pages except the main forum page from the site navigation.
Here are the relevant configurations in the
stkForum template used in our examples. Download configurations.zip to use this template.
The template is configured in STK > Template Definitions
threadReplycomponents are made available in
commentsarea is disabled.
stkForumLoginFormcomponent is made available in
/cssFiles/forum-cssnode. You can view
You can use a combination of page components on a single page. For example you can have
threadList on the same page. The
treadList component will not display until the user clicks a link in the
forumList component, then it renders below it.
/demo-features/modules/forum page with dummy content.
The Forum module component definitions are configured in
All components, except
ForumList have an additional, non-standard property,
allowedParameters. This property is made available by the model class and used by the scripts to render the correct target content. Each component has it's own and (see table below).
Model classes reside in the
info.magnolia.module.forum.frontend.action package. With the exception of
forumList they extend
. The scripts are written in HTML and you can view them in GIT.
The STK Login Form component is an STK component that allows registered users to log in to forums. The component definition and script are included in the configurations.zip download.
By default anonymous users cannot see the forum content, post messages or create threads. See Security for more information.
Here's the component definition in Templating Kit > Template Definitions
/components/forum/stkForumLoginForm. The component extends the
stkPURLoginForm component but uses its own script,
login.ftl. Import the script XML into Templating Kit > Templates
The components are interlinked and have their own navigational structure.
When you add the components to pages:
ForumListcomponent displays the forum content.
threadViewcomponents throw a Template Error because they can only render the content of a selected forum or thread . Navigate from the
forumListcomponent in preview mode to see the content. The warning messages are displayed only to developers during the initial setup of the components. The visitor who uses the forum will see no errors.
Component content is rendered from the
forum workspace. In the
website workspace the only stored properties are UUIDs to the pages that the different components reside on. Here's a
test page we created, with both the
threadList components in
content area in the
website JCR browser, accessible in Tools > JCR.
Dialog definitions are configured in
/modules/forum/dialogs. The names of the component and dialog definitions that are used on pages correspond.
threadView dialog has a link field for a Thread reply page. This option can be used if the
threadReply component resides on it's own page. The reply form forms part of the
threadView component, so this is seldom necessary.
Fixed forums allow you to display a single forum or thread anywhere on the site outside of the standard "forum > thread > message" structure. Here the process begins with the
threadList component. Fixed threads additionally exclude the
threadList component and only the
threadView component is displayed. Use fixed forums and threads to associate a discussion with related content on the site. For example, you could display a baseball forum in the sports section or a thread about a current event next to a news article. When visitors post new messages or threads on the page, both the forum components on standard forum pages and these components are updated with the new content
Here's the procedure to create a fixed forum or fixed thread on non-forum pages:
threadView components to
content area of the page template. The example configuration adds the components to the
stkSection template configured in Templating Kit > Template Definitions >
Add the CSS to the template. You can copy the
cssFiles node in the
stkForum template. The example configuration adds
magnolia-forum-stk.css to the
stkSection template. See Adding theme CSS for an alternative method.
threadListcomponent, select the forum in the Fixed forum field, and link to valid
threadViewpages, i.e. pages on which these components reside. You can use the pages that your actual form uses. Here's the component and dialog on the
threadViewcomponent and select the thread in the Fixed thread field. Here's the component and dialog on the
If you use the forum components on multiple templates you can add the forum-specific CSS sheet at a theme level, instead of a page template level. This way it will be available on all templates that use the forum components. The following configuration in Templating Kit > Themes >
magnolia-forum-stk.css to the
See Security for more information.
The Forum module installs four forum roles in the Security > Roles. These roles have the following permissions:
|All||URL||Get & Post||n/a|
|Forum||Read only||Selected and sub nodes|
|Forum||Post/Write||Selected and sub nodes|
Moderate and Delete
|Selected and sub nodes|
|Forum||Administer (Moderate, Delete and Activate)||Selected and sub nodes|
superuser who is assigned the
forum_All-admin role, these roles are not assigned to any user.
The default roles do not provide access to the Forums menu. Grant the following permission to provide access.
|Config||Read only||Selected and sub nodes|
createRolesForNewForums configuration property is set to
true, a user, moderator and administer role is created automatically for each forum you create.
Anonymous public users cannot view forums by default, because the
anonymous role does not have permissions to read the
forum workspace. You can verify this by logging out of the public instance. This is what the public user sees.
To allow public users to:
forum-baserole to the anonymous user on the public instance. You can use the functionality of the Public User Registration module to register new users.
forum_All-userrole to the anonymous user.
You can use the automatically created roles to provide Post(Write) permissions to individual forums. Use these if you want to provide selective access to individual forums.
If you need both
(GIT) template script and/or the
Here's the rationale behind our recommended procedure for creating forums:
anonymoususer are different on author and public.
Best practice forum creation procedure: