Jump to:

7939 Posts in 1472 Topics by 944 members

DataObjectManager Module

SilverStripe Forums » DataObjectManager Module » Looking for simple code examples

Discuss the DataObjectManager module, and the related ImageGallery module.

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

Page: 1
Go to End
Author Topic: 1213 Views
  • reekrd
    Avatar
    Community Member
    9 Posts

    Looking for simple code examples Link to this post

    Hi.

    Where can I find clean and simple examples of how to use FileDataObjectManager with video?

    I have virtually no prior knowledge of SilverStripe so it would be nice with examples that doesn't assume that the user knows how SilverStripe works as an CMS. Specifically it would be nice with an example that show how to put a video on my homepage. What I want to do in the end is to create a site where I will have a four different video galleries with about 5-6 videos each. Then I would like to be able to promote one video from any of these galleries to the homepage.

    I know this is probably super simple however having only limited knowledge of PHP I can't really wrap my head around how to do this right now. The FileDataObjectManager seem like an option but as I'm not at all familiar with SilverStripe I can't seem to get the bigger picture. I did see the Youtube clip, http://www.youtube.com/watch?v=239nAqxizjA, showing the media feature of FileDataObjectManager. However I don't even know how to puzzle that together.

    Thankful for any help.
    .r

  • UncleCheese
    Avatar
    4085 Posts

    Re: Looking for simple code examples Link to this post

    Well, before you go any further with it, the video features of FDOM require that you have FFMPEG installed on your Linux server. To check if you do, place the line FLV::echo_ffmpeg_test(); in your _config.php. (preferably not on your live site, though)

  • reekrd
    Avatar
    Community Member
    9 Posts

    Re: Looking for simple code examples Link to this post

    I thought if I already had the files available as FLVs then it would work regardless. If that's not the case I doubt I can install it on Dreamhost or Mediatemple.

  • UncleCheese
    Avatar
    4085 Posts

    Re: Looking for simple code examples Link to this post

    You can get most of the functionality with just FLV, but you can't get the thumbnailing. And you'd be surprised -- a lot of hosts have it installed already.

  • reekrd
    Avatar
    Community Member
    9 Posts

    Re: Looking for simple code examples Link to this post

    Ok. It looks like I will have access to ffmpeg on dreamhost, if not I can live without the thumbnails.

    Anyways back to my original problem. How to promote a video to the homepage?

    I managed to copy the code from one of your examples and make it upload and play FLV's. So I have created four pages that all have one video or more. Now I would like to create a simple way to promote any of these videos to my homepage. How would I go about to do that. Of course the nicest would be to be able to show all thumbnails for the videos but as I'm not sure I will have thumbnails a drop down list where I can select the name of the video also works.

    Hope I'm making myself clear and that someone could help me out.

    Best
    .r

  • UncleCheese
    Avatar
    4085 Posts

    Re: Looking for simple code examples Link to this post

    You could probably do a $has_one MyVideoClass on your HomePage object, and then manage the relationship with a HasOneDataObjectManager, right?

    1213 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.