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.

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

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

Ajax requests inside admin section

Go to End

3 Posts   1255 Views


Community Member, 13 Posts

1 May 2013 at 9:10pm

Hi All
My question is about admin section. I have a custom page with set of fields. One of them is «Tags» with many-to_many relation. So I have list with my tags and I can select a few of them without problem. But also I need to add new tag without reloading the page. I guess Ajax is good for this. I am familiar with Ajax, Javascript, PHP but I have no idea how to do that with Silverstripe.


Community Member, 13 Posts

2 May 2013 at 8:29am

The night gone but i sttill search for way to do that.
Is there any tutorial or doc how Silverstripe build his path to objects?
I mean, for example, if I edit my page of type ArticlePage with path /admin/pages/edit/show/7 so how can I access controller of this page rather function GetList() from this controller?


Community Member, 11 Posts

13 June 2013 at 8:39pm

Edited: 13/06/2013 8:45pm


Not sure the thread is still up, but basically, to run an ajax request in SS3, this is how I did :

Include your JS in the "getCMSFields" function of your controller :

class MyController extends Page{
public function getCMSFields() {

This file will be loaded on pages of type "MyControrller".

In the javascript.js (that's an example. I call an ajax request everytime I change the value of a dropdownfield) :

jQuery(document).ready(function($) {
$.entwine('ss', function($){
onchange : function() {
url: '/'+this.val(), // refers to your website of course.
success: function(){
console.log('it worked);
error: function(){
console.log('it failed');

I hope I answered your question.

EDIT : I found a usefull thread, even if it's old, I think it can be useful :)