StartTypo33D-GraphicAustraliaProjectsPrivate




Typo3 » Tutorials » Extensions » Insert a forum

Insert a forum

Author: Karsten Hachmeister

 

In this tutorial I want to show how you can create a forum which looks a little bit like phpBB. It has not the functionality from phpBB, it is only the normal Typo3 forum. Here you can see how it looks like:

 

 

Pagestructure

For the forums create a pagestructure in your tree like the following:

 

 

The page 'Forum' will contain an overview of the forums. The pages 'General' and 'Extensions' will be used to make categories for the forums. They are not clickable. The next level contains the real forums.

When you create the forum pages type in the 'Pagetitle' the name of the forum and in the 'Subtitle' the description of the forum.

If you don't want to use categories you can leave out them. Create the forums then directly under the page 'Forum'. Later use for the content-element of the page 'Forum' the CODE LIST_FORUMS instead of LIST_CATEGORIES.

 

Template

Create in the page 'Forum' a new template. If you use Typo3 version 3.3 or earlier, then add the plugin 'plugin.tt_board_list' to the template. If you use Typo3 version 3.5 or later add in the Extension Manager the Frontend Plugin 'Message board'. Additional paste in the setup field of the template the following TypoScript Code:

 

plugin.tt_board_list {
  templateFile = media/scripts/myboard.tmpl
 
  color1.wrap = #eeeeee
  color2.wrap = #dee2e6
  color4.wrap = #243C56
 
  wrap2.wrap = | 
 
  date_stdWrap.strftime = %a %b %e, %Y
  time_stdWrap.strftime = %X
 
  postform {
    target = _top
    dataArray {
      10.type = data[tt_board][NEW][subject]=input,40
      20.type = *data[tt_board][NEW][message]=textarea,40
    }
  }
 
  postform_newThread {
    target = _top
    dataArray {
      10.label = Subject:
      10.type = *data[tt_board][NEW][subject]=input,40
      20.type = *data[tt_board][NEW][message]=textarea,40
    }
  }
}

 

With 'templateFile' you say what template you want to use for your forum. Color1 and color2 are the grey shades in the forum and color4 is the blue one.

Now upload the file 'myboard.tmpl' to the directory 'media/scripts'. This file contains the HTML Templates for the forums.

 

myboard.tmpl

 

Pagecontent

Create in the page 'Forum' a content-element 'insert plugin' and complete it like in the picture.

 

 

If you created no categories use LIST_FORUMS instead of LIST_CATEGORIES.

For the pages with the forums create also a 'insert plugin' content-element and complete it like the picture.

 

 

Now the forum is ready. If you want have only access to the forum for users that are logged in, please read the tutorial about 'Add a login'.

 

If you have further questions to this tutorial, please ask them in the forum.

 

For a working example look here.