Welcome to the NZRT Wiki Podcast. Today we’re looking at Discussions & Posts.
If you’ve spent any time in the NZRT forum, you’ve probably used these two concepts without thinking much about them. So let’s break down exactly what a discussion is, what a post is, and how they relate to each other.
A discussion is essentially a thread. Think of it as the container — the topic someone starts. A post is a reply inside that thread. And here’s the key detail to keep in mind: the very first post of any discussion is actually the body of that discussion itself. So when someone creates a new thread and writes an opening message, that opening message is technically a post — just post number one.
Now let’s talk about the fields that make up a discussion. There are quite a few, so let’s walk through them. Every discussion has a unique integer ID, and a title, which is the name of the thread. There’s also a slug, which is just the URL-friendly version of that title — the bit you see in the web address. You get a comment count, which tells you the total number of posts in the thread, and a participant count, which counts how many unique users have actually replied. There are two timestamps to be aware of: when the discussion was created, and when the most recent post was added. Discussions can also be locked, which means no new replies are allowed, or sticky, which means they’re pinned to the top of their tag. Finally, discussions carry relationships — links to the tags they belong to, the opening post, and the user who started the thread.
Posts have their own set of fields. Like discussions, each post has a unique integer ID. There’s also a number field, which tells you the position of that post within its discussion — so number one is always the opening post. The content type field tells you what kind of post it is. Most of the time you’ll see “comment,” which just means a normal reply. But there are other types too, like one that logs when a discussion title was changed. The actual text of the post lives in the content field, stored in a format called TextFormatter XML, and there’s also a content HTML field which gives you the already-rendered HTML version. You get a created-at timestamp and an edited-at timestamp for tracking changes. And like discussions, posts carry relationships back to their parent discussion and to the user who wrote them.
So how do you actually create a discussion through the API? The call goes to the discussions endpoint using a POST request. You include an authorization token in the header, and you send along a JSON body. That body wraps everything inside a data object. You specify the type as “discussions,” then inside the attributes you provide the title and the content — the opening post text. You can also attach tags by including a relationships section, where you pass in an array of tag objects, each identified by its ID. So for example, if you wanted to post to the general tag, you’d pass in its tag ID there.
One more thing worth knowing is how post formatting works in Flarum. The forum uses a system called TextFormatter, which is a superset of both BBCode and Markdown. What that means practically is that you can use standard Markdown — things like headings, bold, italic, lists, code blocks, and links. You can also use some BBCode tags depending on which extensions are active. On top of that, you get emoji shortcodes, so typing a colon, the word smile, and another colon gives you a smiley face. And you can use at-mentions to notify another user directly in a post.
That’s the core of how discussions and posts work in the NZRT forum — threads as containers, posts as the content inside them, and a clean API structure for creating both programmatically.
That’s it for this episode of the NZRT Wiki Podcast. Thanks for listening.