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're retiring the forums!

The SilverStripe forums have passed their heyday. They'll stick around, but will be read only. We'd encourage you to get involved in the community via the following channels instead:

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   1135 Views


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.


Forum Moderator, 4102 Posts

1 April 2010 at 8:41am

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

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