Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Extending media presentation

586 views

Published on

Published in: Technology
  • Be the first to comment

  • Be the first to like this

Extending media presentation

  1. 1. Extending Media Module Improve your web authors experience by Alexei Gorobets www.wearepropeople.com
  2. 2. Long time ago in a galaxy far far away… www.wearepropeople.com
  3. 3. How do you manage media in Drupal? www.wearepropeople.com
  4. 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. 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. 6. Where is the user is this maze? www.wearepropeople.com
  7. 7. Let’s be honest… It’s Wordpress 2.7 released in 2008 www.wearepropeople.com
  8. 8. Let’s be honest… It’s Drupal 7 in January 2011 www.wearepropeople.com
  9. 9. Here comes Media Module www.wearepropeople.com
  10. 10. First… Get use of D7 new Entity API to create File entity www.wearepropeople.com
  11. 11. Second… Make file types (Image, File,Video, Text) as entity bundles and they are fieldable www.wearepropeople.com
  12. 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. 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
  14. 14. Looks better? www.wearepropeople.com
  15. 15. Insert into WYSIWYG www.wearepropeople.com
  16. 16. Upload new or select from library www.wearepropeople.com
  17. 17. Select a formatter www.wearepropeople.com
  18. 18. Image inserted www.wearepropeople.com
  19. 19. How it’s handled behind the scenes www.wearepropeople.com
  20. 20. Every tab is a plugin. Create your own! www.wearepropeople.com
  21. 21. Different file types! www.wearepropeople.com
  22. 22. Fieldable file types! www.wearepropeople.com
  23. 23. But! Most valuable is the API!www.wearepropeople.com
  24. 24. Create your Media Browser from Viewswww.wearepropeople.com
  25. 25. Create your Media Browser from Viewswww.wearepropeople.com
  26. 26. or create a class…www.wearepropeople.com
  27. 27. For example:www.wearepropeople.com
  28. 28. Meet hook_media_browser_plugins_alter(). www.wearepropeople.com
  29. 29. Add upload forms for each media browserwww.wearepropeople.com
  30. 30. Add upload forms for each media browserwww.wearepropeople.com
  31. 31. What else? Back to Wordpress! www.wearepropeople.com
  32. 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. 33. Let’s alter the forms Set our submit callback instead of default www.wearepropeople.com
  34. 34. Let’s alter the forms Set redirects using media-popup setting in query www.wearepropeople.com
  35. 35. Let’s alter the forms Alter file attributes form, remove fields, make Cancel button work! www.wearepropeople.com
  36. 36. Let’s go for a demo! www.wearepropeople.com
  37. 37. Questions? www.wearepropeople.com
  38. 38. Thanks! www.wearepropeople.com

×