Sign In
Start Page | Recent Changes | All Pages | Orphan Pages | Junebug Help

Installing Extension - Page Attachments

This page exists because many people have had difficulty installing and using the page_attachments extension. Please refer to this page before questioning the mailing-list.

Thanks, Sean

First things first

Make sure your Radiant project is functional. You can find directions for installing and configuring Radiant here. This includes making sure your web server will correctly run the dispatcher, etc. Please consult your hosting provider for information on how to run a Rails application like Radiant.

If you want page_attachments to be able to display thumbnails of uploaded images, make sure that one of image_science, mini-magick, or rmagick is installed on the server. You can check this by running:


 $ gem list

Install attachment_fu:

svn export http://svn.techno-weenie.net/projects/plugins/attachment_fu/ vendor/plugins/attachment_fu

Failing to do the above step will result in a “uninitialized constant Technoweenie::AttachmentFu” error.

If you get the error uninitialized constant Technoweenie::AttachmentFu::Backends try this instead:

svn export http://svn.techno-weenie.net/projects/plugins/attachment_fu/ vendor/extensions/page_attachments/vendor/plugins/attachment_fu

Step-by-Step

1. Download the page_attachments extension into the proper directory using the ‘svn’ command (you can use checkout or export). If you are using the 0.6.4 gem, you will need revision 58, see below:


 $ cd /path/to/my/radiant/project
 $ svn checkout http://svn.radiantcms.org/radiant/trunk/extensions/page_attachments vendor/extensions/page_attachments

For revision 58, you will need to get it from Sean’s personal svn repository:


 $ svn export http://svn.seancribbs.com/svn/rails/plugins/extensions/page_attachments vendor/extensions/page_attachments -r 58

2. page_attachments requires Radiant 0.6.2, so either freeze edge or use the 0.6.2 gem or later:


 $ rake radiant:freeze:edge

3. Now run the extension migrations:


 $ rake production db:migrate:extensions

4. Run the ‘update’ task to copy the appropriate assets from the page_attachments extension:


 $ rake production radiant:extensions:page_attachments:update

5. Restart your application and/or web server.

Using page_attachments

When you login to your Radiant admin and edit a page, you should see an area below the main interface that says “Attachments (0)”. Click the ”+” icon to add an attachment. You can upload multiple attachments at once. Attachments will not be saved or removed until the whole page is saved. Therefore, if you accidentally deleted something you meant to keep, simply cancel the page-edit.

Referencing attachments in the page

Please see the Tag Reference in the page-editing interface for the latest documentation on how to use attachments in a page.

Troubleshooting

Migration problems

If you have a problem running the migrate task, and it fails with an error something like this.


ld: library not found for -lfreeimage
collect2: ld returned 1 exit status

It means you have installed the ImageScience gem but you don’t have FreeImage installed. So, either install FreeImage or uninstall the gem like so:


gem uninstall image_science

RubyInline problem

If you’re using ImageScience as a user without a home directory, you may see this error:


Define INLINEDIR or HOME in your environment and try again

This is caused by RubyInline not having a place to store its generated files and can be easily fixed by specifying a path in your environment file like so:


ENV['INLINEDIR'] = File.join(RAILS_ROOT,'tmp','ruby_inline')

Version 22 | Other versions: « older newer » current versions
Page last edited by andrewo on July 22, 2008 03:21 AM (diff)