Blog
Channel file handling for ExpressionEngine
January 06, 2012
I've been thinking about the way that file handling is done in ExpressionEngine 2.0 lately. I think I've come up with a design that would be a lot easier to work with and provide a lot of additional options beyond what we have right now. Basically the idea boils down to this:
Files should be stored as channel entries.
Actually, the idea is pretty obvious just from looking at the UI of ExpressionEngine 2.0. The Files listing is even put under the Content menu item, and has a very similar look to the listing of channel entries - but where it breaks down with the current implementation is the backend. Files aren't stored as channel entries, even though the UI implies that they would be.
Imagine being able to create multiple File Channels, each one with it's own meta data fields created as Channel Fields. Relationship fields like Playa would allow more complex relationships between files and the content that uses them. Every existing custom field type could be used to provide really advanced meta data for file uploads. The possibilities are endless.
Basically this implementation would need two things:
- Create a simple File Upload field that is available in all channels. Create a Channel Preference that shows or hides this field. Each channel with this option enabled becomes what we currently know as a "File Upload Preference".
- Re-work file management UI (including the built in File upload field type) to use this new data backend instead of the current files tables and File Upload Preferences.
So that's my idea. Your thoughts?