An extension that provides some useful blogging tags for the Radiant CMS
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.



BlogTags is an extension for the Radiant CMS that provides some useful blogging tags. OK, for now there are just three tags. But they're really useful. Honest!

The latest version is available on GitHub.

    git clone git://

previous and next

The previous and next tags get the previous and next siblings of the current page, sorted by the published_at date. For example,


will get the previous page according to the published_at date and output a link to it. You can specify which attribute to use for comparison in the by attribute. To get the next page according to the page title, use

<r:next by="title"><r:link/></r:next> 

Inside the next and previous tags you can use whatever page tags you like and they'll refer to the next or previous page. If your pages have a summary part, you could output the summary for the next page like this:

<r:next><r:content part="summary"/></r:next>

Of course I have no idea why you'd want to do that, but you could.

Since this is the BlogTags plugin, the previous and next tags are designed to be used in a blog. Here's how I use the previous and next tags on my site to provide links to the previous and next blog entries:

<div class="article-nav">

This produces HTML like

<div class="article-nav">
	<p><a href="/articles/2006/06/06/jimmy-and-ginas-wedding/">&laquo;&nbsp;Jimmy and Gina's Wedding</a>&nbsp;&nbsp;<a 	
	    href="/articles/2006/06/22/railsconf-2006/">RailsConf 2006&nbsp;&raquo;</a></p>

When you're viewing the first page in a sequence, the previous tag outputs nothing. The next tag outputs nothing if you're at the last page in a sequence. Also, virtual pages (like "Archive Day Index" or "Page Not Found") are excluded from the page sequence, since you probably don't want to link to them this way.


The time_ago_in_words tag outputs the published_at date of the page (or, for unpublished pages, created_at) in natural language. For example, if it's 4:00pm and the page was published at 1:00pm the tag


would output about 3 hours. I use it like this in my blog:

<p class="article-author">Posted by <r:author /> <r:time_ago_in_words /> ago</p>

which outputs something like:

<p class="article-author">Posted by Sean about 3 hours ago</p>


If you have questions you can find me on the Radiant mailing lists or you can contact me through my website. Good luck!


Thanks to John Long for creating Radiant and for providing a starting point for the previous and next tags. Thanks also to Sean Cribbs for his suggestion on simplifying my time_ago_in_words implementation.