mu.nu - It's mackerel stewed in chocolate!
June 21, 2006
Foruming With Minx
So, I hear you cry, how do forums work in Minx?
I'm glad you asked! Forums are blogs. Blogs are forums. (And also Wikis, but we'll come back to that later.) To view your blog as a forum, all you need to do is add a couple of new templates. For Munuviana, these are:mxForum <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">And viola! Forums! To really work like a forum, the posts need to be sorted by date of the last comment, rather than the date the post was entered. Minx can't do that yet (at least not with the MT database), but will. One little note: the post.even flag is true if this post is even numbered, counting the posts on the page from 1 to N. Yes, there is a corresponding post.odd, and some other flags for breaking posts into groups of three or whatever. Then, all you do is add the option form=forum to the URL to tell Minx to pick up the mxForum template instead of the default mxPost template, and you're done. You can use the even/odd widgets to do a two-column blog like this, but it only really works if all your posts are the same length - or if you have a 100-word excerpt for the front page (which Minx can generate automatically, but I need to test that).
<html><head>
<title>Minx/MT: Dynamic Pages for Movable Type</title>
<link rel="stylesheet" href="http://blog2.mu.nu/minx.css" type="text/css" />
</head>
<body>
<div id="container">
[include banner]
<div id="center"><div class="content">
<h2>Munuviana Forum</h2><p>
<table>
<tr><th width=50%>Topics</th><th width=15%>Comments</th>
<th width=15%>Author</th><th width=20%>Posted</th></tr>
[posts:here template=Forum.Post]
</table>
[magic.pager]
[magic.stats]
</div></div> <div id="right">
<div class="sidebar">
[include recent]
</div></div>
</div> <div style="clear: both;"> </div> </div> </body></html> mxForum.Post <tr [if post.even]bgcolor="#f8f4e0"[/if]>
<td><a href="[post.url]">[post.title]</a></td>
<td align=center>[post.comments]</td>
<td>[post.authorlink]</td>
<td>[post.date]</td>
</tr>
Posted by: Pixy Misa at 05:27 AM | Comments (3) | Add Comment | Trackbacks (Suck)
1
If posts and comments are the same data entity, you can make tree-structured forums.
Just sayin'. (I hate tree-structured forums. Too easy to get lost among the branches.)
Just sayin'. (I hate tree-structured forums. Too easy to get lost among the branches.)
Posted by: David Boxenhorn @ at June 23, 2006 11:55 AM
2
In Minx/MT, posts and comments aren't the same. In real Minx, they are, for that reason among others.
Processing 0.0, elapsed 0.0078 seconds.
22 queries taking 0.0053 seconds, 24 records returned.
Page size 9 kb.
Powered by Minx 0.8 beta.