Day Three with Radiant

Wed, 06 Jan 2010

Post comments: View Comments

As with any usual project, there is always the need for creating custom content and custom content types. That is why, in Day Three with Radiant I will look at adding custom behavior to Radiant. I think this is an important part of any CMS and the way the system allows you to create custom content is very critical.

If you look at the directory structure of a typical Radiant project you will notice that the app folder that is usually found in a Rails application is missing. This means that the normal way of creating models, views and controllers that is available in Rails is not offered to us by Radiant. To achieve this goal we have to resort to using extensions. A number of articles can be found on the subject on the wiki page Creating Extensions.

The first guide to look at is the How-To: Create an Extension. The method they suggest in this tutorial is to create a separate Rails application that contains the models, views, controllers and migrations. Make sure that this application contains all your logic and data that you require, then copy the necessary files to the extension directory that you have created. Then run the migration and update script. When that is done, you can now add the routes required by your extension and you are done, or are you?

If you need to add custom page types, which are pages with custom behavior, your work is not done yet. You will need to follow the instructions on this page. And if you require custom Radius tags, you will have to do something like what is suggested in this tutorial.

This whole process looks tedious to me. It seems that the work required for a developer to be able to add new models or content types is doubled by the fact that the developers have to maintain a temporary application where the new models are developed and tested. It is possible to create your extension straight in your Radiant project but you will not have the assistance of the generators, which can be very helpful and time saving. The tutorial does mention the following:

Until there is an extension scaffolding generator

So hopefully a future version of Radiant will include these generators and make this task less time consuming and easier on the developers.

One concern that I still have is the fact that Radiant takes the dominant role of the project owner or project parent which means that the application lives within Radiant. This is opposed to the case where the CMS is an extension of the original application. This might present problems for projects where a CMS became a requirement or a necessity after the original code base has been developed. A project that will include Radiant, is a project that needs to be created as a Radiant project from the start or has to be exported into a Radiant extension. Most CMS systems out there present the same conundrum for developers. So in the case where a CMS is needed to enhance a website by providing a means to create static pages or a blog, a CMS that can be installed as an addition or extension to the application (such as BrowserCMS) has an advantage over a CMS like Radiant.

Overall, Radiant seems like a good candidate for projects where you know upfront that you will be using a CMS. It has good core documentation by the Radiant developers and an extensive list of extensions. Extending the application yourself is possible and relatively easy even though it requires a number of steps to be taken. Following the mailing list and browsing the wiki pages give me the impression that the project is in full swing and development on it is always progressing. Also, the community provides great support. At the conclusion of Day Three with Radiant I can say that this CMS is worth a shot if you are starting a new project and want to take advantage of the things that Ruby and Ruby on Rails provide you.