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:

Customising the CMS /

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

Custom Javascript in the Admin

Go to End

2 Posts   2738 Views


Community Member, 244 Posts

26 February 2013 at 4:35pm

I'm trying to add custom javascript to a tab in the CMS admin area

I can include the javascript easy enough by adding the following to the _config.php file


However, the file loads in only once, when the CMS is first opened.
I need to run the script when the contact page is loaded in CMS.
And not just when it's loaded, but when it's saved, it needs to run again to refresh the content


Community Member, 187 Posts

26 February 2013 at 11:03pm

You'll need to use Entwine for this, see here:

The best way to learn how Entwine works is to look at, for example, /framework/admin/javascript/LeftAndMain.EditForm.js.

I've recently done a similar thing, that calls a function whenever it detects a field (used for Google Maps):