Jump to:

10994 Posts in 2728 Topics by 1819 members

All other Modules

SilverStripe Forums » All other Modules » New Module: SiteMedia - Easily add Photos, Videos, and more to your Objects

Discuss all other Modules here.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1
Go to End
Author Topic: 1072 Views
  • brice
    Avatar
    Community Member
    51 Posts

    New Module: SiteMedia - Easily add Photos, Videos, and more to your Objects Link to this post

    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

    Enjoy,

    ~ Brice

  • HeartlandTech
    Avatar
    Community Member
    17 Posts

    Re: New Module: SiteMedia - Easily add Photos, Videos, and more to your Objects Link to this post

    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.

  • brice
    Avatar
    Community Member
    51 Posts

    Re: New Module: SiteMedia - Easily add Photos, Videos, and more to your Objects Link to this post

    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.

  • HeartlandTech
    Avatar
    Community Member
    17 Posts

    Re: New Module: SiteMedia - Easily add Photos, Videos, and more to your Objects Link to this post

    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.

  • brice
    Avatar
    Community Member
    51 Posts

    Re: New Module: SiteMedia - Easily add Photos, Videos, and more to your Objects Link to this post

    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

    ~ Brice

    1072 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.