Comparing version 4 and version 3
h2. What are “extensions”? Part of what makes RadiantCMS great, in my opinion, is that it fulfills the need for most content-management scenarios with pages, layouts and snippets. It’s flexible and puts minimal restriction on the structure of the output. It reaches the 80% window. However there are those cases in the missing 20% where you might have other needs, for example: * Integration with some back-end data service * Management of a complex data structure that doesn’t fit into the Radiant page-layout-snippet structure (or fits poorly) * Receiving and processing input from the website visitor through forms or other means * Complex manipulation of content information that would be impossible or too cumbersome using Radius In 0.5.2 and before, page “behaviors” fulfilled many of these concerns. For example, the Mailer behavior processes form-to-email submissions, and the RSS Behavior inserts the headlines from a news feed into a page. However, “behaviors” are focused on processing individual pages and are not well suited to, say, manipulating other models in an administration interface. This is where “extensions” come in. Extensions are vertical slices of a Rails application, or mini-applications if you will, that are inserted into Radiant at runtime. In many ways, they tackle the same problem as Rails Engines, which allow you to drop a pre-built application into your own and use it as if it were the same app. The execution of this feat has been quite arduous, and you can read more about it on "John’s blog":http://www.wiseheartdesign.com/2006/12/6/rails-needs-something-better-than-engines/. Suffice it to say, with a minimal amount of boilerplate, you can have your own custom models, views, controllers, and libraries running inside Radiant. That’s the power of extensions. h2. Installing Extensions A number of extensions are available for download on the [[Thirdparty Extensions]] page. h3. Using Subversion Externals If you are using Subversion for your Radiant project, the best way to install an extension is to use "svn:externals".Your editor should start up. Then add a line for the extension you’d like to use:cd /path/to/radiant svn propedit svn:externals vendor/extensionsSave your changes then do an update:extension_name http://example.com/svn/extension_name/trunkh3. Alternatively You can use Subversion to export the extension into your vendor/extensions directory. This is the approach to take if you are not using Subversion for your project, but you want to use an extension from someone else's repository:svn update vendor/extensionsh3. Installation for Extensions that Don’t Use Subversion If the extension author provides a .zip or .tar.gz file, just extract it into your vendor/extensions directorycd /path/to/radiant svn export http://example.com/svn/extension_name/trunk vendor/extensions/extension_nameh3. Migrate Your Database for New Extensions An extension may require that you update your database. Radiant provides a simple migration to get you up to speed:cd /path/to/radiant cd vendor/extensions tar zxf /path/to/extension.tar.gzNow your extensions should be ready to go! (Extension developers should remember to always update their README files or provide adequate information on the use and function of your extension elswhere).$ rake db:migrate:extensionsh2. Creating Your Own Extensions See the [[Creating Radiant Extensions]] tutorial.
