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

New Admin Module

Go to End

14 Posts   4555 Views


Community Member, 8 Posts

16 September 2010 at 4:21am

Edited: 16/09/2010 4:23am


I have to create a Admin Module for one of my customers, hopefully when i am finished i also can publish it on ;).

But i have some problems finding the right way to create the module, because its not that good documented, or the documentation is a little out of date Also i am working with the newest release of silverstripe and read about the changes that were made, as specially in the javascript section.

So before i start, i would like to know if there is a example of code, which shows me how to create a admin module, with a seperate section like the files/media module. Which module would be best to look at? So i can see how to create a module with jquery instead of prototype - so that i am future safe ;)

thanks and best regards



Forum Moderator, 1899 Posts

16 September 2010 at 5:01am

I'd like to second this, I posted here a couple of weeks ago asking for help with essentially a custom LeftAndMain - with no response.

Every time I need to do something that doesn't fit into the site tree or ModelAdmin my heart sinks because there is basically nothing (except trying to emulate an existing, uncommented, unclear module - naming no names) - and I have failed at this.

If there is anything that explains something like this or goes into any detail on how to customise LeftAndMain I would be very grateful for too.



Community Member, 271 Posts

16 September 2010 at 5:44am

Edited: 16/09/2010 5:49am

I created an Extended ModelAdmin which allows the use of Panels instead of the default ModelAdmin sidebar.

I use it on a few simple projects now and it seems to work quite solid.

See this trhead for more info:

In this post you can find two download links, one for the PanelModelAdmin and one for a demo implementation.

See this slides for what it does:

Its not extensively tested yet, and it still contains a lot of duplicate code, but it should point you to the right direction and it makes creating a custom LeftAndMain much easier then extending LeftAndMain directly.

Let me know what you think of it.

Edit: Note that some code examples in the slides are changed. See the ProductAdmin example for how it works at the moment...


Forum Moderator, 1899 Posts

17 September 2010 at 1:08am

Thanks Martijn - I'll check that out. I'm going to prepare my attempts as well and maybe get a tutorial together - best way to learn is to be able to teach it!



Community Member, 271 Posts

17 September 2010 at 6:12pm

Edited: 17/09/2010 6:41pm

You need to set this in Article:

static $admin_parent_class = 'Category';

Indeed, this might be an idea to set that in the MenuPanel array. (Not sure if this will work after saving an item at the moment...)

I will take a look at the ajaxstring this weekend... (see Edit below)

Note that this is still just a proof of concept, and there are some known issues with buttons showing up on wrong places :).

But besides that all should work as ModelAdmin does.


Your right. The function getResultsAssembly in CategoryMenuPanel is missing a & at r79. thanks:

function getResultAssembly($sgn){
		$columns = $sgn->stat('summary_fields');
		$search = '?';
			foreach($columns as $k => $v){
				$search	.= 'ResultAssembly['.$k.']='.$k.'&';
		} else {
			$field = $sgn->hasDatabaseField('Title') ? 'Title' : 'Name';
			$search	.= 'ResultAssembly['.$field.']='.$field.'&';
		return $search;


Community Member, 271 Posts

21 September 2010 at 10:05am

Can you pastie your code?

Yes I will do, but it still needs some refinement...


Community Member, 271 Posts

23 September 2010 at 6:25am

Yes no I remember :)

At this moment you have to add CategoryID to the searchable fields as well...

I'm trying to fix this within PanelModelAdmin, but this is not easy...

add this as well to Article.php

static $searchable_fields = array(


Community Member, 271 Posts

23 September 2010 at 6:57am

I added the module in a repo:

Go to Top