3. The [forum] ITL Tag

The [forum] tag is what provides the capability. It uses the forum table and follows tree-like threads in that table.

It has one required parameter, top. That gives the id of the message that is the top of the thread to display.

This is a complete forum display for a product:

        [forum top="[item-code]" /]

You will see something like that in the snip from pages/flypage.html above.

You can pass many more parameters to the [forum] tag. Some of them are:

display-page

By default, the [forum ...] tag uses the current page to link to to re-display the forum at another level. Normally this works fine, but on a product flypage it will not work. You must pass in a different page.

        [forum top="[item-code]" display-page="forum/display" /]

show-level

By default, [forum] only displays the text of top-level replies to the current thread. If you want to display more levels, set the show-level parameter to 1 or higher:

        [forum top="[data session arg]" show-level=3 /]

The above will show the first four levels of replies, with links to any further down the tree.

scrub-score

If you want to moderate certain comments so that their text won't be shown, you can set the scrub-score parameter to -1 and then set the score field in the message's database record to -1. By default, it is linked to with a message:

  <A HREF="{DISPLAY_URL}">One message beneath your threshold</A>

If you want to totally disable the appearance of the link and message, set the scrub-template to something:

        [forum top=THREAD
                   scrub-score="-1"
               scrub-template="<!-- killed! -->"
        /]

show-score

By default, if a message has a score of two or higher, it's text will be shown no matter what level of display it is on. You can set that threshold with this paramter.

template

You can set the template that displays replies with this parameter. You can also pass this as the container text for the [forum] tag, i.e.:

        [forum top="[data session arg]"]
        <table cellspacing=0 cellpadding=2 width="65%">
                  <tr>
                        <td class=contentbar1>
                                <A HREF="{DISPLAY_URL}"><b>{SUBJECT}</b></A>
                                by <b>{USERINFO}</b>
                                on {DATE}
                        </td>
                        <td class=contentbar1 align=right>
                                &#91;
                                        <A HREF="{REPLY_URL}"><b>Reply</b></A>
                                &#93;
                        </td>
                  </tr>
                  <tr>
                        <td colspan=2>
                        {COMMENT}
                        </td>
                  </tr>
                </table>
        [/forum]

See pages/forum/display.html for an example.

header-template

You can set the header template that displays the top-level message with this parameter. See pages/forum/display.html for an example.

link-template

You can set the template that displays the links to messages that are not shown with this parameter. See pages/forum/display.html for an example.

scrub-template

The template for a message that has a score lower than scrub-score. See pages/forum/display.html for an example.

threshold-message

The message displayed in the default scrub-template when a message is scrubbed. If you set the scrub-template yourself, it is ignored.

display-page

The page linked to with {DISPLAY_URL}. Default is the current page. See Templating below.

reply-page

The page linked to with {REPLY_URL}. Default is forum/reply.html. See Templating below.

submit-page

The page linked to with {SUBMIT_URL}. Default is forum/submit.html. See Templating below.

date-format

The format for the date provided with {DATE}. Default is %B %e, %Y @%H:%M, which provides a date like October 5, 2002 @21:19.