Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Extending media presentation
1. Extending Media Module
Improve your web authors experience
by Alexei Gorobets
www.wearepropeople.com
2. Long time ago in a galaxy far
far away…
www.wearepropeople.com
3. How do you manage media in Drupal?
www.wearepropeople.com
4. Administrator
• Many modules to use, every module with it s own features
• Complex for new users, no simple solutions
• No way to integrate all solutions with WYSIWYG
• Training required in most cases
• No way to reuse uploaded content
www.wearepropeople.com
5. Developer
• Every module provides it s own solution for the problem
• Many new field typex and many new widgets for the same idea
• Tons of modules that implement the same in different aspects
• No way to manage your files in cloud (S3, CDN)
• No consistent API to extend existing solutions
www.wearepropeople.com
6. Where is the user is this maze?
www.wearepropeople.com
7. Let’s be honest…
It’s Wordpress 2.7 released in 2008
www.wearepropeople.com
8. Let’s be honest…
It’s Drupal 7 in January 2011
www.wearepropeople.com
10. First…
Get use of D7 new Entity API to create File entity
www.wearepropeople.com
11. Second…
Make file types (Image, File,Video, Text)
as entity bundles and they are fieldable
www.wearepropeople.com
12. More…
• Integrate files in WYSIWYG
• Reuse your files by browsing your Library
• Use different formatters to display your files
• Consistent API to extend for developers
• Use StreamWrappers from D7
www.wearepropeople.com
13. StreamWrappers?
• Use url like s3:// and youtube:// to access remote files
• Remote and local files are treated the same way
• Easy way to add new wrappers
www.wearepropeople.com
32. We want to edit file attributes on file upload
• Set a proper file name
• Assign OG audience to the file
• Set other usefull attributes
www.wearepropeople.com
33. Let’s alter the forms
Set our submit callback instead of default
www.wearepropeople.com
34. Let’s alter the forms
Set redirects using media-popup setting in query
www.wearepropeople.com
35. Let’s alter the forms
Alter file attributes form, remove fields, make Cancel button work!
www.wearepropeople.com