Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

DataObjectManager Module /

Discuss the DataObjectManager module, and the related ImageGallery module.

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

HasOneFileDataObjectManager CMS display


Go to End


4 Posts   1324 Views

Avatar
micahsheets

Community Member, 165 Posts

18 August 2010 at 5:51am

Silverstripe 2.3.2 with most recent DOM that was built for 2.3.

Three questions regarding FileDOM.

1. Is there a HasOnlyOneFileDataObjectManager where there is only ever the possibility to have a single object instead of lots of objects with a radio button to select the current one? An interface that would have no paging or drag and drop etc but still have a nice uploader?

2. Since I don't have ffmpeg ( I tried to get it installed but couldn't ), I have set up my FileDOM to manage my own Extension of the FLV class. My extension allows me to associate a pre-made thumbnail with my video. However I can see that the FLV class is still trying to create a thumbnail regardless. The thumbnail object shows up in the Files table. Actually when I upload a video it creates two files. An flv_thumb_0 and an flv_thumb_{whatever the ID of the video is}. However these two files don't actually exist in the thumbnails folder. How can I tell the FLV class to skip the thumbnail creation process alltogether?

3. I have it set up to show a CMS thumbnail version of the custom thumbnail in the grid view of the FileDOM. This seems to cause the trash can icon to be partially hidden under the bar that has the allow drag and drop checkbox. Is there a way to make that bar be pushed down by whatever container is holding the icons etc for the videos?

Avatar
UncleCheese

Forum Moderator, 4102 Posts

18 August 2010 at 6:28am

Hi, Micah. Good to hear from you.

1) You can use a FileIFrame field, or for a nicer interface, stay tuned for the Uploadify module, which I'll be releasing very soon.

2) The FLV features were predicated upon having FFMPEG, so I can't really support using those features in its absence, but I'd probably start by updating the onBeforeWrite() method in FLV.php:

if(!$this->getThumbnail())
$this->createThumbnail();

becomes:

if(self::has_ffmpeg() && !$this->getThumbnail())
$this->createThumbnail();

3) Not sure.. I know CMSThumbnail brings in a lot of markup with it, so I usually use a custom getter for that.

public function getDOMThumb() {
return $this->SomeImage()->CroppedImage(50,50);
}

Avatar
micahsheets

Community Member, 165 Posts

18 August 2010 at 6:35am

Thanks for this info. You always are on top of your game. I look forward to the Uploadify module.

Im back from Basic Training and am off to Tech School in a week. So you probably won't hear from me again for a couple of months.

Avatar
micahsheets

Community Member, 165 Posts

18 August 2010 at 10:45am

I was able to get the Thumbnails show up in the DOM but I had to make them so small. If I had control over the Layout and CSS of the DOM I would probably change the markup so that that lower bar would be pushed down by whatever was above it. It doesn't matter if I use CMSThumbnail or Cropped image because all I am doing is passing in the source path of the image so no markup is brought in it is just that the default image happens to be really small so it always works. I always hate to go messing about with your core but in this case since it is the old version of DOM and SS it probably doesn't matter. However on another site I am using the newest versions of everything and this is still an issue. Maybe if you run into needing bigger thumbnails yourself you might look into updating it.

Thanks as always for your hard work and help.