Radiant On Crack
I really should have updated this earlier. I've renamed my attachments extension. Full installation instructions are:
cd RAILS_ROOT/vendor/extensions
svn co http://soxbox.no-ip.org/radiant/svn/extensions/admin_parts/
svn co http://soxbox.no-ip.org/radiant/svn/extensions/part_attachments/
If you want to have all the image manipulation goodness, you'll also need fleximage and rmagick installed.
cd RAILS_ROOT/vendor/plugins
svn co http://beautifulpixel.com/svn/plugins/flex_image
gem install rmagick
I'm pretty sure the rest of the information in the last two blog posts is accurate.
Posted by Daniel on Feb 06, 2007
I’ve now finished:
- a way to upload asset for a page that hasn’t been created yet.
If you upload an asset and subsequently don’t save the page, it’s still
left orphaned though (probably just have a rake task to clean.
- Caching. Currently using the exact same mechanism as the rest of radiant
(ie. 5 minute expiry and stored in yaml files). Not the best approach for
either large assets or manipulated images.
So that leaves:
- a nice way to edit/delete images
- validation
- tests
- confidence that you can use this without screwing up your data/life/mind.
But I’ll probably put those off for the moment.
Posted by Daniel on Jan 02, 2007
I’ve been toiling away at another Asset Management extension – originally I started just playing round with Keith Bingham’s extension, but I’m pretty much dumped all that code now.
http://soxbox.no-ip.org/radiant/svn/extensions/part_assets
This extension requires that you’re running on the mental branch, and
that you also have my admin_parts extension installed:
http://dev.radiantcms.org/svn/radiant/branches/mental/
http://soxbox.no-ip.org/radiant/svn/extensions/admin_parts
Features of this extension:
- Images are linked to each page, rather than being global.
- Images can be manipulated using FlexImage. Just dump a transform_name.flexi file into ‘app/views/assets’ and you can transform images:
app/views/assets/polariod.flexi
@image.resize! :size => '100x100'
@image.border! :size => 3
@image.shadow!
And in the page:
<r:image name=”monkey.jpg” transform=”polariod”/>
There’s also a default.flexi that all images are passed through – these
files contain just ruby code and get passed both the @asset and the
owning @page, so you could do default transformations depending on the
type of page involved.
If FlexImage isn’t installed, the extension can continue to be used as a
basic asset management system.
This isn’t complete. I don’t have:
- a way to upload images for a page that hasn’t been created yet.
- a nice way to delete images
- much in the way of validation
- anything in the way of tests (it’s probably going to crash early and often)
- any caching whatsoever (your CPU will likely get choked if you try running this in production with transforms under even slight load)
- any confidence that it wont destroy all your data or kill your first born child (use at own risk)
I’m pretty excited about how this extension is turning out – I’d love some feedback, and any offers of patches are always welcome.
Posted by Daniel on Jan 02, 2007
I think given my glacial pace of development that dumping my branch and going with extensions is the way to go. Herewith, my first radiant extension.
I’ve had a bit of a play with giving extensions access to the admin
pages. I’ve gone with the concept of having ‘AdminPart’ classes. A page
class has an admin_parts array, listing the admin part classes, ie.
Page.admin_parts = [TitleAdminPart, ExtendedMetadataAdminPart,
PartTabAdminPart]
These are rendered through corresponding partials under an admin_parts
directory (ie, TitleAdminPart becomes admin_parts/_title.rhtml). The
page controller then passes off to each of the admin parts to save their
data back to the model.
I’ve got an extension that implements this (in a very rough way), and an
proof of concept example.
http://soxbox.no-ip.org/radiant/svn/extensions/
The only noticable change from having the extension installed is that at
the moment when you save a page, the parts are saved off regardless of
whether the save of the entire page is successful. Doesn’t bother me at
the moment though.
Posted by Daniel on Dec 08, 2006
Sorry for the long absence.... not that there was anybody listening. Because Radiant has shifted since I last set foot here, I've moved off most of my changes and pulled in a fresh copy of the 'mental' branch to play on.
Hopefully I'll get something done this time.
Continue Reading…
Posted by Daniel on Nov 10, 2006