Browsing your assets with style

I have the pleasure to introduce a new plugin called sfAssetsLibraryPlugin. See it as a media library on steroids.

State of the art

Many symfony projects use the sfMediaLibraryPlugin in their backend application. Until today, it was the only publicly available plugin for managing images and other assets in a symfony application via a web interface.

But this plugin had limited abilities in terms of file and folder management. You could rename a file, but that’s about all. Worse, it didn’t allow you to add metadata to your assets. Managing a large image library without ever dealing with copyright or legend is almost impossible.

Lastly, every CMS-like application needs a robust asset management utility, hooked into rich text editors, to allow writers to deal with images without pain. I saw numerous tweaked versions of the sfMediaLibrary made for that purpose, all reinventing the wheel of the ‘advanced media library’.

One step forward

Today, my company releases a new media library plugin called sfAssetsLibraryPlugin. It is a complete rewrite of the initial media library plugin. It introduces a database layer in addition to the asset files stored under your web root, adds a ton of new file management features, and was built with customization in mind.

Add files on-the-fly in the directory your’re browsing, rename files and folders, move entire folders and their content alltogether, find assets by filename, upload date, author, description or copyright, integrate tightly with TinyMCE… That’s only some of the features of the plugin.

Oh, and if you have an existing sfMediaLibrary, the new plugin will import your assets as soon as you call the bundled synchronize pake task.

Of course, you can change its look and feel (below is a screenshot of the plugin integrated in our backend) and add your own metadata columns with sfPropelAlternativeSchemaPlugin. Our implementation adds tagging abilities to assets, and it takes only a couple more lines in the application code, without ever touching to the plugin code. We made sure the plugin was very clean and easy to extend.

customized edit view

The plugin has currently been used in my company for several months, and even if tagged as beta, you can download it right away. Of course, it has I18n, unit tests, PHPDoc and a text documentation - you should consider these as the standards of symfony plugins. The sfAssetsLibraryPlugin is released under the MIT license, for your sharing pleasure.

Who did it

The plugin is the work of William Garcia, Gabriele Santini and myself, and it took us quite some time to finalize the plugin so it is truly customizable and powerful. We will keep on maintaining the plugin in the future, so expect more features in the upcoming months (drag and drop files to move them, for instance).

I want to express my warm thanks to both William and Gabriele for their work. I am very proud of the result, and I believe it is a huge step forward in the ‘build your application with plugin legos’ direction.

Of course, feedback is welcome. If you find a bug, please file a ticket in the symfony Trac with sfAssetsLibraryPlugin as component. And if you want to volunteer to enhance the plugin, file a ticket, too, and just wait for our green light to start working on a patch.

Possibly related posts (automatically generated):

9 Comments so far

  1. Olivier on June 11th, 2008

    congrats to the team ! (specially William ….)

    cool plugin indeed

  2. Joshua Taylor on June 12th, 2008

    I thought you left symfony? Or are you going to keep releasing awesome plugins?

  3. Francois Zaninotto on June 12th, 2008

    @Joshua: I left the symfony core team. But I keep on using symfony on a day-to-day basis. I have a very large application to maintain, which requires half a dozen devs full time. And I’m still open-source minded… So expect more plugins in the future.

  4. Taku on June 12th, 2008

    Great work, that’s really interesting, I already know where I’m gonna use it … superb, thanks for your stuff François :).

    By the way, are you still working on the sfPropelFinderPlugin ? It was such a great piece of code …

  5. Jimmi Andersen on June 16th, 2008

    Once again, great work Francois :)

  6. forkmantis on June 20th, 2008

    It’s great to see new stuff from you, Francois. This is a great plugin, and came at the perfect time for me.

  7. Paolo on June 23rd, 2008

    Great. Is it posible to use it as repository for files you don’t want to be available for all the public ? (Files that you upload but only available for certain users)

  8. Luis on August 28th, 2008

    Can i create thumbnails of videos with these plugin ?

  9. Francois Zaninotto on August 28th, 2008

    @Paolo: yes, you decide where to put the data. It has to be under the web/ folder, but depending on your server config, you can allow a directory to some hosts and not all.

    @Luis: Not natively, but the plugin is very heasy to extend. You should give it a try. But as for videos, putting your video files under the web folder is, to my mind, not the best solution. I suggest hosting them with a specialized video platform.