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

Getting javascript into the DOM popup


Go to End


2 Posts   1254 Views

Avatar
MarcusDalgren

Community Member, 288 Posts

1 April 2010 at 8:20am

Hi Uncle Cheese!

Is there a way to get my own javascript into the DOM popup?
I've created a data object that uses Google maps in its form and right now I'm injecting my custom javascript through the literal field. That's almost too nasty for words but I tried putting Requirements in the beginning of getCMSFields but the scripts I tried to require that way did not show up in the popup.

Is there some other better way of doing this or am I stuck with my nasty solution?

I've thought about making a field like Rossiter has done in his module but I'd really like to store latitude, longitude and the google address in separate fields and don't really know the best way of approaching making a field that really is several fields.

Avatar
UncleCheese

Forum Moderator, 4102 Posts

1 April 2010 at 8:41am

I would just put your own DataObjectManager_popup.ss in your theme dir, and add a require tag..

<% require javascript(some/js/file.js) %>