This forum has moved to a new location and is in read-only mode. Please visit talk.octobercms.com to access the new location.

SnipiBA
SnipiBA

Hi guys, im trying to find some solution, how to execute mediafinder commands externally (programatically) from other plugin. Some ideas or examples? Thanks

daftspunky
daftspunky

Need a little more info, what type of commands are you wanting to call?

SnipiBA
SnipiBA

daftspunk said:

Need a little more info, what type of commands are you wanting to call?

Not sure if you see plugin "Unique Media Finder", but. Idea behind is, that i need to call "navigateToFolder" or "selectFile" to allow users easily download and use photo from stock photos in doubleclick. Currently i changed "currentFolder" and triggered "refresh" button programatically, which makes what "i need", but probably it is not really "nice solution". See here: https://www.youtube.com/watch?v=tSKQIGTR7-M

daftspunky
daftspunky

I see, well the media manager plugin is exposed on the element it is bound to, which then exposes all its functions

Let's say I attach media manager to a div with id="mydiv"

$('div#mydiv').mediaManager();

I can get the media manager object from the same div with this

var mediamanager = $('div#mydiv').data('oc.mediaManager');

Now I can call any function I like

mediamanager.gotoFolder('somepath');

Most JS plugins will allow this. Hope it helps

SnipiBA
SnipiBA

Thanks, works great...

Last updated

1-5 of 5

You cannot edit posts or make replies: the forum has moved to talk.octobercms.com.