Creating a Forum Content Type

A forum is displayed in a content item with some special characteristics. You therefore need to add at least one forum content type definition to your publication's content-type resource (located in the publication's META-INF/escenic/publication-resources folder).

A forum content type must have the following minimum characteristics:

  • A parameter called com.escenic.forum.articleType, which must be set to the value forum.

  • A title field (that is, a field that is designated as the title field using the ui:title-field element).

  • An enumeration field called moderation-scheme, with two enumeration values:

    post-moderation

    This means that postings will be posted before they have been moderated, and may subsequently be withdrawn by the moderator.

    pre-moderation

    This means that postings will not be posted until they have been approved by the moderator.

    Moderation functionality is dependent on the Dashboard plug-in. If the Dashboard plug-in is not installed, therefore, the contents of this field will be ignored. You should, nevertheless, always include a moderation-scheme field in your Forum content types.

The following example shows a content-type resource containing such a content type:

<content-types
    xmlns="http://xmlns.escenic.com/2008/content-type"
    xmlns:ui="http://xmlns.escenic.com/2008/interface-hints"
    version="4">
  <content-type name="forum">
    <parameter name="com.escenic.forum.articleType" value="forum"/>
    <ui:title-field>title</ui:title-field>
    <panel name="Standard">
      <field name="title" type="basic" mime-type="text/plain">
      </field>
      <field name="moderation-scheme" type="enumeration">
        <enumeration value="post-moderation"/>
        <enumeration value="pre-moderation"/>
      </field>
    </panel>
  </content-type>
</content-types>

In most cases you should also add a boolean field (called active, for example) that you can use to control whether or not the Forum is open for posting. For example:

<content-types
    xmlns="http://xmlns.escenic.com/2008/content-type"
    xmlns:ui="http://xmlns.escenic.com/2008/interface-hints"
    version="4"
  <content-type name="forum">
    <parameter name="com.escenic.forum.articleType" value="forum"/>
    <ui:title-field>title</ui:title-field>
    <panel name="Standard">
      <field name="title" type="basic" mime-type="text/plain">
      </field>
      <field name="moderation-scheme" type="enumeration">
        <enumeration value="post-moderation"/>
        <enumeration value="pre-moderation"/>
      </field>
      <field name="active" type="boolean">
    </panel>
  </content-type>
</content-types>

The content type may in addition contain any other fields you want (a body field, for example).

Once you have added such a content type to your publication's content-type resource, a Content Studio user with sufficient privileges will be able to start a forum by simply creating and publishing a new content item of the type forum.

Note that the above examples are deliberately kept as short as possible: labels are omitted, for example.