<?xml version="1.0" encoding="UTF-8"?>
<article>
  <content>&lt;p&gt;Amongst all the revolution happening in the Web 2.0 era, web publishing has been a revolution in itself. In recent times, the concept of web publishing has evolved itself into a major field of software development and have got eyeballs from all over the world. Content Management Systems have been the result of this movement both commercial and Open Source. Blogs, Wikis and CMS like Drupal, Joomla has become extremely popular for making it substantially easy to publish content over the web, and help the users focus on content rather than worrying about the code.&lt;br /&gt;Radiant CMS, as their website defines is &amp;ldquo;Radiant is a no-fluff, open source content management system designed for small teams&amp;rdquo;. This means it does not boast of too many amazing features out of the box but provides a light and flexible framework to develop with. As an introductory article, I will walk you through the installation of Radiant CMS and then familiarize you with the terminology associated with the system.&lt;br /&gt;Installing Radiant&lt;br /&gt;Anyone with even basic knowledge of Rails can go through the setup of Radiant in a&amp;nbsp; breeze. I will start the installation on my local machine, which is an Ubuntu 8.10. The pre-requisites for installing Radiant on your machine are Ruby 1.8.6 or later, Rails 2.1, MySQL/PostgreSQL/SQLite3 and RubyGems.&lt;br /&gt;saurabh@laptop:~$ gem install radiant&lt;br /&gt;Once, the gem is installed, create your project directory and change directory to it:&lt;br /&gt;saurabh@laptop:~$ mkdir radiant&lt;br /&gt;saurabh@laptop:~$ cd radiant/&lt;br /&gt;The radiant command with the database switch creates a Rails Radiant application for you. You can then select the database as MySQL, Postgres and SQLite3, which changes the config/database.yml file according to the selected database. In my case, my choice was MySQL.&lt;br /&gt;saurabh@laptop:~/radiant$ radiant --database mysql /home/saurabh/radiant/&lt;br /&gt;As a result of running this command, you will get a list of directories created just as in a Rails application. . Here are the folders that gets created on running this command:&lt;br /&gt;CHANGELOG&amp;nbsp; CONTRIBUTORS&amp;nbsp; INSTALL&amp;nbsp; log&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Rakefile&amp;nbsp; script&lt;br /&gt;config&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; db&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; LICENSE&amp;nbsp; public&amp;nbsp; README&amp;nbsp;&amp;nbsp;&amp;nbsp; vendor&lt;br /&gt;We now change the config/database.yml to suit our database settings. By default, Radiant needs the user to create only a production database, however the user can choose to create a development and/or a test database too.&lt;br /&gt;saurabh@laptop:~/radiant$ rake production db:bootstrap&lt;br /&gt;Once we run this in our project directory, the bootstrap script will migrate the tables and add them to the database. At the end of that process, the script asks the user some questions necessary to setup and administer the application.&lt;br /&gt;Create the admin user (press enter for defaults).&lt;br /&gt;Name (Administrator): saurabh&lt;br /&gt;Username (admin): admin&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;Password (radiant):&lt;br /&gt;&lt;br /&gt;Initializing configuration.........OK&lt;br /&gt;&lt;br /&gt;Select a database template:&lt;br /&gt;1. Empty&lt;br /&gt;2. Roasters (a coffee-themed blog / brochure)&lt;br /&gt;3. Simple Blog&lt;br /&gt;4. Styled Blog&lt;br /&gt;[1-4]: 4&lt;br /&gt;&lt;br /&gt;Creating Snippets....OK&lt;br /&gt;Creating Pages....OK&lt;br /&gt;Creating Layouts....OK&lt;br /&gt;Creating Page parts....OK&lt;br /&gt;&lt;br /&gt;Finished.&lt;br /&gt;Once we are through with these questions, we can start up the server in production mode and navigate to the http://localhost:3000/ to see our application up and running.&lt;br /&gt;saurabh@laptop:~/radiant$ script/server -e production&lt;br /&gt;&lt;br /&gt;We are now ready to manage the content, so we navigate to http://localhost:3000/admin/login and login with the credentials we provided during the installation process. Once inside, we are presented with the administrator panel as shown in Figure 2.&lt;br /&gt;&lt;br /&gt;Getting familiar with the Radiant terminology&lt;br /&gt;The first tryst with Radiant might confuse you but once you understand the organization of components in Radiant, you can actually unlock the real power of Radiant, which is&amp;nbsp; high modularity and re-usability of the components.&lt;br /&gt;We will first get familiar with the small components that form a Page in Radiant, and then dive into how this page is formed using these sub-components.&lt;br /&gt;Radius Tags&lt;br /&gt;Radius tags are tags similar to HTML tags, but specific to Radiant CMS. They can be used anywhere inside Pages, Snippets or Layouts, except the names. Radius tags are intelligently built into four categories and that&amp;rsquo;s what differentiates it from other tags. These are:&lt;br /&gt;Content Tags: These tags refer to the different page attributes like title (&amp;lt;r:title/&amp;gt;),or content (&amp;lt;r:snippet /&amp;gt;) and are mostly self enclosing in nature.&lt;br /&gt;Tags that change Page context: These tags refer to a container tag and control from which page the contained tags get their content, e.g. &amp;lt;r:parent&amp;gt;&lt;br /&gt;Conditional Tags: They start with &amp;lt;r:if_ or &amp;lt;r:unless_ and are container type tags. Only when the conditions defined in the tag are satisfied, the contained content or other elements are rendered.&lt;br /&gt;Tags that work with collections: They are mostly the tags that do not fall under any other categories.&lt;br /&gt;We can write custom radius tags in order to extend the radiant markup.&lt;br /&gt;Snippets&lt;br /&gt;As the name goes, snippets are small pieces of code, that perform different functions and can be reused. A snippet just needs to be created once. If you have to use some text across several different pages, reuse some pieces of code over different layouts, you can simply create a snippet and call it within that page or layout.&lt;br /&gt;We can add a snippet as shown in the code sample below, by navigating to the snippet tab in the admin panel and clicking on &amp;ldquo;snippet&amp;rdquo;. Here is an example of how you can create a reusable snippet:&lt;br /&gt;Name: table_of_contents&lt;br /&gt;Snippet:&lt;br /&gt;&amp;lt;r:children:each limit=&amp;rdquo;10&amp;rdquo; order=&amp;rdquo;desc&amp;rdquo;&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;lt;li&amp;gt;&amp;lt;r:link /&amp;gt; &amp;lt;/li&amp;gt;&lt;br /&gt;&amp;lt;/r:children:each&amp;gt;&amp;lt;/ul&amp;gt;&lt;br /&gt;While saving, you have an option of keeping it as Markdown or Textile. Once created, this snippet can be called from within a page using a radius tag as follows:&lt;br /&gt;&amp;lt;r:snippet name=&amp;rdquo;table_of_contents&amp;rdquo;/&amp;gt;&lt;br /&gt;Layouts&lt;br /&gt;Layouts are like the body of HTML. They help us define how the page will look like and how the various elements will be arranged on the pages. Layouts are also reusable, just like Snippets and can be included under other layouts too. The various portions of the layout like the content, can be written in any language we desire, apart from the radius tags, like HTML, XML, JavaScript. The screen to create a layout can be seen in Figure 3.&lt;br /&gt;&lt;br /&gt;Pages&lt;br /&gt;Pages follow a Parent &amp;ndash; Child structure. A parent page can have many children pages and they can in turn have their children pages. This structure makes the site organization easier. Figure 4 shows how the page Admin looks like.&lt;br /&gt;&lt;br /&gt;Pages are filled by snippets and layouts, yet they have their own set of attributes:&lt;br /&gt;Title: This is the name of the Page in plain text. This shows up on&amp;nbsp; the title bar of the browser when the page is displayed.&lt;br /&gt;Slug: Slug is the link to the page being made. This link is generally taken automatically from the title of the page but it can be customized by clicking on the More link and then providing a custom text for it. Spaces are not allowed because these are parts of the URL.&lt;br /&gt;Breadcrumb: Breadcrumb is for the user to see the navigation on the page. It is displayed in a format such that, a sequential trail is created starting from parent to the current page. It depicts the hierarchy of the page structure.&lt;br /&gt;Other parts on the Page Admin are:&lt;br /&gt;Filter: This is helpful in selecting the content type for the contents and parts to be defined in a particular page. The default options of Filter are Markdown, Smarty pants and Textile.&lt;br /&gt;Page Types: Page type helps us define the kind of pages for the site. Pages can be Normal, Blog Type and Archive. Depending upon the selection, they are showed in the final output. With File Not Found, a customized error page can be generated and used in case the defined error occurs on the site.&lt;br /&gt;Status: The Status of a Page depicts whether it has been saved or published by the user. Once published, the user will be able to see the page according to one&amp;rsquo;s definitions.&lt;br /&gt;&lt;br /&gt;Extensions&lt;br /&gt;Radiant, just like any other CMS can be extended easily, when the default functionality of the radiant framework is not sufficient. There are several extensions available for Radiant, common ones being TinyMCE Editor and Latex for displaying mathematical formulaes and much more.&lt;br /&gt;Conclusion&lt;br /&gt;Radiant, as they say, is a no fluff CMS, provides us with a modular architecture which can be easily played around with. For a Rails programmer or a small rails team, Radiant makes it easier to extend and customize it to the specific needs of the user. Radiant also has a very active open source community.&lt;/p&gt;</content>
  <created-at type="datetime">2009-08-30T03:28:01Z</created-at>
  <discuss-url>http://railsmagazine.com/forums/2/topics/71</discuss-url>
  <id type="integer">42</id>
  <issue-id type="integer">4</issue-id>
  <number type="integer">6</number>
  <title>Feel the Radiance with Radiant CMS</title>
  <updated-at type="datetime">2009-12-24T20:52:26Z</updated-at>
</article>
