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

Uploadify (how to implement a custom action)


Go to End


2 Posts   1485 Views

Avatar
nicolant

Community Member, 6 Posts

9 September 2011 at 3:49am

Anyone, please point me in a right direction.

I want to add a new tab to ImageUploadField, and to place there a field to enter a timecode, and button to get preview from FLV attached via FileUploadField above, as shown in the image:

I've extended ImageUploadField and set a new template for it, with code for butrton as:

<button type="submit" class="{'url' : '$Link(extract)'}">Extract from video</button>

But where (in which class) to place a "function extract(...)" and why Firebug console shows corresponding request as
http://localhost/zavod/admin/EditForm/field/Media/item/3/DetailForm?SecurityID=...
i.e. without /extract chunk after "DetailForm"?

Thank you in advance, and sorry for not so good English...

Avatar
UncleCheese

Forum Moderator, 4102 Posts

10 September 2011 at 1:37am

I assume you have created a subclass of ImageUploadField? The function can go in there. Form fields are actually controllers. Just don't forget to add the "extract" action to your allowed_actions, too.

--------------------
SilverStripe tips, tutorials, screencasts and more: http://www.leftandmain.com