[Radiant] Working through an Extension
Mohit Sindhwani
tech at onghu.com
Sat Aug 4 07:53:26 CDT 2007
Hi Guys,
After my request for help towards figuring out how to not include a
stylesheet in the menu, I thought it would be quite good to try to
create an extension that allows me to specify a property which I could
use to add pages to a menu.
I read through most of how the PageAttachments extension works and it's
really neat (in my opinion) how it extends the Page model and the way
that the Edit and New pages are changed to include fields to attach
files, etc. I've set up the extension in exactly the same way as
PageAttachments, but I'm facing a problem in trying to add items to the
database.
Basically, I have an after_save filter that gets called when you try to
save the page. All I need to figure out now is how to get the page ID
of the record that was just saved, and more importantly, the parameters
that were entered into the partial added to the new and edit page.
If I understand it correctly, the PageAttachments uses AJAX for
uploading files to a temporary location and then saves them in the
after_save filter by iterating through an array that is populated with
the names of the files that were uploaded. I don't need something that
complex (and I'd prefer not to use AJAX), so I'm wondering how to access
the text field! (Let's say I have a text field called 'property' that I
would like to add). I know that this may be a Rails issue (rather than
specific to Radiant), but I'm hoping someone can point me in the correct
direction with this.
Thanks for all the patience, guys!
Cheers,
Mohit.
8/4/2007 | 8:52 PM.
More information about the Radiant
mailing list