10 extensions for Radiant CMS you can’t live without

Radiant CMS is a great content management system. It’s Rails, it’s simple … in fact it is so simple that you are bound to be missing some basic features once you start implementing your web site.

This is by design. Radiant has a fantastic infrastructure for extensions, and rather than imposing a lot of advanced functionality making the software harder to get started with for everyone, it lets each developer make his or her own choices.

Still, even with the official extension registry it can be hard to navigate the many extensions out there. Many people have asked me what I recommend for just getting basics such as reordering, image upload and menu generation. There is no final answer to that question, but this article covers 10 extensions that are compatible with the newest versions of Radiant and gives you functionality you can’t live without.

Continue reading

Hello Merb

Merb is getting merged into Ruby on Rails. Together they will become Rails 3, as announced by David Heinemeier Hansson here and Yehuda Katz here.

I wish I could claim to have been playing with Merb for a while and have some real insight into the framework, but to be honest, I haven’t. I still think this a very interesting news, though, and in my opinion this can only be good news for the Rails community. Already, the brilliant Merb guys are optimizing and improving Rails, for instance this 8% speed boost in using respond_to.

So, how can we expect the the merge to affect the Rails framework we know and love? Let’s peek into the possibilities of combining these two frameworks.

Continue reading

Removing Rails validations with metaprogramming

I recently found myself facing a metaprogramming challenge. I solved it by combining two terrible ugly hacks, and as such I won’t say I found a solution that is anywhere near to be elegant.

My problem was this: I was developing a Radiant extension called tags_multi_site, which allows the tags extension to play nice with the multi_site extension. This required me to scope all tags within a site, so that tags with the same name could exist in different sites, but in the same physical database table.

The tags extension has this validation:

class MetaTag < ActiveRecord::Base
  validates_uniqueness_of :name, :case_sensitive => false
end

I needed to add :scope => :site_id, but I couldn’t touch the code of tags extension itself, since that would terribly un-DRY and not reusable for anyone else. I had to either modify the existing validation programmatically from my own extension or to remove it and add my own.

Continue reading

Writing a custom Radiant page type

I haven’t blogged much over the summer, but I have a fair number of excuses:

  1. Vacation
  2. When I have had the time to write, I have tried to prioritize my now almost finished master’s thesis
  3. I got a lot of fun computer games and interesting books for my birthday
  4. When I have had the time to write, but haven’t felt like writing on the thesis, I have felt I should prioritize the Summer Reboot documentation project for Radiant

Excuses aside, I think my latest contribution the the Radiant documentation base turned out quite good. It describes how to create a custom page type in Radiant in an extension, adding page tags, custom fields and other good stuff.

Check it out in the Radiant wiki.

(I’m headed for RailsConf Europe in the beginning of September, and I hope a lot of articles will come out of that as usual – hope to see you there!)