Using Plugins in Extensions


I’m working on a banner ad extension for a friend and am currently using
file_column plugin (althought I’ve been thinking about using
instead) to handle the image upload. Right now I’ve just stuck it in
root app’s vendor/plugins directory. Is this acceptable practice or is
there a better way to do it? I know the gallery module handles the
upload manually, but I wanted to stick with a proven method without
rewriting existing code.

Any thoughts?


I’m still a relative Ruby/Rails/Radiant rookie; however, that’s what
I’ve been doing. I basically ask myself, “Do I want this plugin
affecting all Radiant instances or just the one instance?” That answer
determines where I put it. Using the root helps with staying DRY.

If you want an example of how to integrate a plugin into an extension,
check out page_attachments. It’s not especially straightforward…
you might have to dump code from init.rb of the plugin in the activate
method of your extension.


This is what I have been doing, but I really reccomend shifting to
attachment_fu. The killer feature is also that you can have image
processing without RMagick, which leaks memory and is generally a
pain. ImageScience, MiniMagick and RMagick are all provided, as well
as DB and file system storage.

Like Sean said extension. Look at his page_attachments for some good
examples. I will be updating some of my own extensions to match the
new hooks for the views.

Keith B.
Tel: +49-7731-79838380
[email protected]