10713 Posts in 2391 Topics by 1763 members
|Go to End|
26 February 2011 at 6:09pm
I've just released a module to GitHub. The goal of this module is to make it easy on the developers to add media to their objects and to make it easy on site administrators by providing a consistent "media" tab in the CMS to upload new, or choose existing media.
This is a re-usable component that solves the problem of managing a common library of extensible media types and decorating your Pages and DataObjects with them. Example media types are; a Photo with a Caption and Title, a Video with Poster Image, Thumbnail Image, and Caption, a Audio File with a Related Artist, etc. etc.
The module also aims to be "natural" to SilverStripe developers and designers... laying an intuitive blueprint for new media types (I'll release a YouTube example soon) and media gallery templates.
I worked this up late last night... so it's in a pre-release state, but have already adopted it on a larger site we're working on && am happy with it and would love to hear any feedback!
SiteMedia Page & Source: https://github.com/briceburg/silverstripe-sitemedia
3 March 2011 at 5:39am
Is this module functional? I downloaded it and tried to use it and got a new page type but beyond that I saw nothing else. I am using version 2.4.5.
3 March 2011 at 6:26am
The module is functional. You will need to specify what classes you would like to decorate with media. For instance, you can add Media to all pages by including "SiteMediaRegistry::decorate('Page');" in your mysite/_config.php. See the module's _config.php file for further examples of usage.
The SiteMediaPage is still a work in progress. I imagine I'll have that wrapped up as well as CSS/JS for the SiteMedia.ss example markup in the next week or so -- but the module is 100% functional from the back-end, leaving it to you to implement front-end display.
Please let me know if you have further questions.
3 March 2011 at 10:06am
I added it to mysite/_config.php and then tried to add a photo type. I got this:
Fatal error: Call to a member function Photo() on a non-object in C:\www_docs\SilverStripe-v2.4.5\sitemedia\code\types\SitePhoto.php on line 47
I don't know exactly how remove the error now, when I add a SiteMedia page type it immediately gives me this error.
3 March 2011 at 10:15am
Be sure you're using the current version from GitHub. SitePhoto.php only has 41 lines. Also; whenever you add types or decorate objects with media /dev/build must be run.
If this doesn't work please post your mysite/_config.php
|Go to Top|