A recent comment on my Mindtouch intro page asked how I built the discussion board.
I originally got the code from the Mindtouch Developer site here, however I can’t seem to find the complete source code anymore. Either way, I’m pretty sure neilw, a valuable contributor to the Mindtouch community is the author of this code and full credit goes to him.
The actual implementation is very simple. You just need to make a couple of templates.
First, create the discussion board page template, or topic list:
Template:/ForumTopicList
{{wiki.create("Create New Topic",homepath,(args.template ?? "ForumTopic"),true,"Put Your Title Here")}}
Topic
Starter
Replies
Last Comment(C) or Edit(E)
Views
{{t.sticky}} {{web.link(t.page.uri, t.page.title)}}
{{ t.originator; }}
{{#t.page.comments}}
{{date.format(string.substr(t.date,1),'yyyy-M-d H:mm');' '; if (t.change != '(new)') { 'by '; t.author; ' '; } t.change; }}
{{t.page.viewcount}}
(no topics yet)
Then call this template somewhere on your page, with this:
{{ template("ForumTopicList") }}
Now, you need to create the template for the actual new topic post:
Template:/ForumTopic
Created by {{ edit: web.link(user.uri, user.name) }} on {{ edit:"{{ save:date.now}}" }} |
{{ if (page.tags.sticky != nil) { "STICKY"; } }} | {{ web.link(page.feed, "Track this page") }} |
Instructions:
|
<enter your topic message/description here>
You can modify this template to include whatever instructions you like.
That’s it! To create a new topic, navigate to the page that you call the ForumTopicList template, and click the “Create New Topic” button:
When others comment on the page that’s created, it will count as “replies” and show in the topic list.
Worked like a charm! Thanks!