Hi all,
Following a few discussions that I read here before, and my site needs I
have decided to try and implement an option for attaching files, adding
events and other goodies.
I decided to try an approach of adding a type to each page part, so
thatwhen
you create a new page part you can choose the page part type, simple
page
parts acts exactly like the page parts we had so far, but you can easily
create page parts that allows for attachments, setting events, images,
etc.
I did that by setting a few simple hooks in the radiant source that
calls an
external PagePart class for managing of the following actions:
- Showing the page part to visitors to the web page (on calls to
<r:content
part=“xyz” />) - Showing the admin interface for the page part on creat or edit
- Saving the page part data
- deleteing page part data
I also added a column to the page_part table called page_part_type_id
Creating new page parts is similar to creating behaviors or filters.
You can see samples, screenshots and some of the code on
http://www.drortirosh.com:8080 (hope it is not too slow)
Waiting to hear what you think,
Dror