
Security News
The Changelog Podcast: Practical Steps to Stay Safe on npm
Learn the essential steps every developer should take to stay secure on npm and reduce exposure to supply chain attacks.
radiant-forum-extension
Advanced tools
This is a tidy but comprehensive forum implementation that plugs into radiant and supports both discussion forums and page comments.
This new (as I write) version 2 is a complete rewrite with a lot of internal clarification in preparation for rails 3. It's only a release candidate at this stage: I'm working on bug fixes, documentation and packaging for public release. There is also a developing demo and documentation site that you can use as a starting point. Code is at https://github.com/spanner/radiant-forum-demo and the site will be public soon.
The forum is designed to be pick-and-mixed with other radiant extensions, so it's focused on being a good forum and doesn't do anything else. I hope you will find it's good at what it does do:
I've tried to keep it simple and tidy both inside and out. This is helped by the fact that all the user-management is in the reader extension, so you should find this is easy to adapt and extend. The admin interface on the other hand is pretty basic: we expect most administration to happen through the public pages but there does need to be at least a dashboard to give a better overview. That will come soon.
As far as I know this is the only decent forum software available for rails. If I can't find a better alternative, I will spin this off as a separate rails 3 engine that works alongside radiant but does not require it.
You can find a standard radiant forum installation at https://github.com/spanner/radiant-forum-demo. It serves many purposes: integration test target, reference platform, documentation and demo site and starting point for larger projects. There is some way to go on the documentation front but it should already serve as a useful starting point.
This code has been surviving in the world for five or six years (and more, since some it originally came from Beast), but this version is about 75% new and you know what that means: new bugs. Github issues are always welcome.
This version is not multi-site compatible. It relies heavily on configuration items that are not yet site-scoped. That's next on the list after radiant 1 comes out.
Radiant 0.9.2 (we're using the new configuration interface) with the reader extension. Reader has a few requirements of its own so it's best to install that one first, make sure it's testing clean and then install the forum.
sudo rake gems:install
should get everything you need.
The forum is easy to use and almost entirely separate from your page hierarchy. Forums - which are described as 'discussion categories' most of the time and not emphasised much in the reader-facing pages - are created and edited in the admin interface, and there readers can also (soon) be promoted to moderate selected forums. Everything else is done through the reader interface including the editing and deletion of posts and topics.
There is now a configuration panel for the forum and you shouldn't have to do any console-tinkering.
Every string used in the public-facing forum (and reader) pages comes from the locale file. They are labelled functionally rather than literally, with keys like forum_extension.no_search_results. To change the wording, either edit or override the locale.
Forum pages have their own controllers but they are presented inside your normal radiant layouts. Use the configuration interface to choose the layout you want to use. Your layout can work in the usual way: all we do is define page parts for you to include with <r:content part="something" />. These are the parts available:
<r:content />) gives you the main list, object or form.<r:content part="pagetitle" />These parts are only defined where they're relevant, so you can do something like this:
<h1 class="pagetitle">
  <r:content part="person" />
  <r:content part="breadhead" />
  <r:title />
  <r:content part="feed" />
</h1>
and it will look right for all the forum pages.
You probably also want to include this somewhere, as on all reader-service pages:
<r:if_reader><r:reader:controls /></r:if_reader>
Have a look at the included sample layout for a starting point.
Forum and reader views are not cached, by default, but commented pages are. It is possible to cache the forum if you omit any dynamic content (such as the reply form), but at some cost to ease of use.
Group functionality has recently been folded into the reader and forum extensions, so you don't need to install a whole tree of tiny changes any more. The interface hasn't quite settled down, but the functionality is solid: associate a forum with a group, and all of its contents are visible only to members of that group.
The forum has its own simple search mechanism. It's not very bright but it has two great advantages: you can combine text search with filtering by author and category, and you can bookmark any search query as an RSS feed to be alerted when new posts match that search. There are arguments for integrating this with eg sphinx_search but at the moment I quite like keeping them separate: I find that searching for messages is not the same as searching for pages, but usually a different group seeking different results. Let me know if you disagree.
The search is implemented just by passing parameters to posts_controller#index, so you can link to addresses like /forum/posts?q=something&reader_id=45 or put <r:forum_search> somewhere in your forum layout. See the tag documentation for control of the search form presentation.
To enable page comments, all you have to do is put <r:comments:all /> somewhere in the layout (or in a snippet or on an individual page). Behind the scenes this will create a dedicated forum for page comments and a topic for each page as it is commented upon. The rest of the mechanism is the same, and the comments themselves are just posts.
The page cache means we don't want anything personal on the page itself - no edit controls or logout buttons - but there are a couple of ways you can get around this with a remote call.
<r:comments:remote /> on the page instead and a stub will be included suitable for your scripts to grab. A simple example is included in platform/forum.js.<r:comments:all /><r:comments:link /> is more efficient but less friendly: it will give you a static list of all comments followed by a reply link. Posting a comment clears the page cache, btw.You can also use <r:comments:each>...</r:comments:each> and the various r:forum:post tags to compose page comments however you like. See the tags-available documentation for details.
The reader extension includes email confirmation and a simple honeytrap that should prevent most bots from registering. The forum includes proper XSS protection via the sanitize gem and the usual CSRF protection is enabled. You ought to be relatively spam-free.
The forum comes with some jquery-based scripting to handle inline administration and a few other useful functions. It's entirely unobtrusive and I assume you will want to replace or extend it. You should find the page DOM is quite simple and robust.
Included here is a redcloth extension to handle emoticons of the type inserted by the punymce toolbar we're using. I've customised the set to make accidental emoticons less likely. There will soon be an option to disable them completely.
In the short term, very likely. Github issues, please, or for little things an email or github message is fine.
FAQs
Unknown package
We found that radiant-forum-extension demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Learn the essential steps every developer should take to stay secure on npm and reduce exposure to supply chain attacks.

Security News
Experts push back on new claims about AI-driven ransomware, warning that hype and sponsored research are distorting how the threat is understood.

Security News
Ruby's creator Matz assumes control of RubyGems and Bundler repositories while former maintainers agree to step back and transfer all rights to end the dispute.