Apostrophe 1.5: legacy documentation

Still using Apostrophe 1.5? Check out Apostrophe 2 for your future projects.

Media Enhancements Plugin

apostropheMediaEnhancementsPlugin

apostropheMediaEnhancementsPlugin introduces batch upload capabilities in the media library. It is still alpha quality. It does not currently support Internet Explorer (older browsers, including IE9, get the old multi-input file uploader). If you wish to use it please provide accurate bug reports. Patches are appreciated.

To enable the batch uploader in your project:

1. Make sure the apostropheMediaEnhancements plugin is included in your svn externals.

cd into your plugins directory and run:

svn pe svn:externals .

Add the media enhancements plugin to the bottom of the list if it isn't already there:

apostropheMediaEnhancementsPlugin http://svn.apostrophenow.org/plugins/apostropheMediaEnhancementsPlugin/trunk

2. svn up from the project's from the root directory to get the plugin.

3. Add the plugin to your ProjectConfiguration.class.php file. In config/ProjectConfiguration.class.php, you'll find an enablePlugins array:

    $this->enablePlugins(array(
      'sfDoctrinePlugin',
      'sfDoctrineGuardPlugin',
      'sfDoctrineActAsTaggablePlugin',
      'sfTaskExtraPlugin',
      'sfWebBrowserPlugin',
      'sfFeed2Plugin',
      'sfSyncContentPlugin',
      'apostrophePlugin',
      'apostropheBlogPlugin',
      'apostropheExtraSlotsPlugin',
      'apostropheFeedbackPlugin',
      'apostropheImportersPlugin',
      'apostropheMysqlSearchPlugin',
      'apostropheAwesomeLoginPlugin',
      'apostropheCkEditorPlugin',
      'apostropheHTML5Plugin',
      'apostrophePeoplePlugin',
      // This is the new line
      'apostropheMediaEnhancementsPlugin'
    ));

4. Add aEnhancedMedia to your enabled modules in settings.yml.

5. Make sure you're including the necessary less and js files in your view.yml. It should look something like this:

  stylesheets:
    - /apostropheExtraSlotsPlugin/css/aExtraSlots.less: { data-asset-group: global }
    - /apostropheFeedbackPlugin/css/aFeedback.less: { data-asset-group: global }
    - /apostropheAwesomeLoginPlugin/css/aAwesomeLogin.less: { data-asset-group: global }
    - main.less: { position: last, data-asset-group: global }
    - /apostropheMediaEnhancementsPlugin/css/a-media-enhancements.less: { data-asset-group: global }

  javascripts:
    - /apostropheBlogPlugin/js/aBlog.js: { data-asset-group: global }
    - /apostropheExtraSlotsPlugin/js/aExtraSlots.js: { data-asset-group: global }
    - /apostropheFeedbackPlugin/js/aFeedback.js: { data-asset-group: global }
    - /apostropheAwesomeLoginPlugin/js/jquery.tmpl.js: { data-asset-group: global }
    - /apostropheAwesomeLoginPlugin/js/aAwesomeLogin.js: { data-asset-group: global }
    - /apostropheMediaEnhancementsPlugin/js/underscore-min.js: { data-asset-group: global }
    - /apostropheMediaEnhancementsPlugin/js/backbone-min.js: { data-asset-group: global }
    - /apostropheMediaEnhancementsPlugin/js/apostrophe.html5.uploader.js: { data-asset-group: global }
    - /apostropheMediaEnhancementsPlugin/js/apostropheMediaEnhancements.js: { data-asset-group: global } 
    - site.js: { position: last, data-asset-group: global }                                               

6. Create symbolic links to the plugin's assets:

./symfony plugin:publish-assets

7. Add the following lines to the "aMedia" block in your project level app.yml file.

  aMedia:
    # overrides for aEnhancedMediaPlugin
    templateOverrides:
      index_success_partial: aEnhancedMedia/indexSuccess
      show_success_partial: aEnhancedMedia/showSuccess
      edit_success_partial: aEnhancedMedia/editSuccess
      upload_success_partial: aEnhancedMedia/uploadSuccess
      videoSearch_success_partial: aEnhancedMedia/videoSearchSuccess
      searchServices_success_partial: aEnhancedMedia/searchServicesSuccess

8. Switch to jQuery 1.7.1. 1.4.3 is the default with Apostrophe projects but it does not support the batch uploader's JavaScript?. Apostrophe has been well-tested on jQuery 1.7.1 but to maximize backwards compatibility we don't force this on you by default.

Go into app.yml and find the use_bundled_javascripts setting. Make sure jquery 1.7.1 is uncommented and 1.4.3 is commented out.

9. symfony cc

You should be up and running with batch uploads in the media library. Expect bugs. Please send us feedback and patches.

Thanks for checking it out!