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.

All other Modules

Discuss all other Modules here.

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

New Module : Create custom LeftAndMains with PanelModelAdmin

Go to End

10 Posts   3634 Views


29 September 2010 at 4:09pm (Last edited: 29 September 2010 4:09pm), Community Member, 271 Posts

I created a module which extends the possibilities of ModelAdmin, in order to be able to create custom LeftAndMains without extending LeftAndMain directly, but to use the power of ModelAdmin.

Some Silverstripers already knows this from the Google dev list and the IRC channel and I think it can be usefull for a wider audience.

PanelModelAdmin allows a flexible manner to devide the left sidebar in seperate searchpanels, menulists or custom panels which all can have their own managed DataObjects. In this way you have more flexibility to organize your DataObject management.

See this slideshare for how it looks and what it can do:


Create custom panels for the sidebar
Create custom (nested) menulists (with parent => child relations)
Create custom panels to show whatever you want (plain content, rss etc.)

Use TableListField, TableField or ComplexTableField for the ResultsField (DOM support is in progress).
Show a default ResultsForm on the initial view of the admin panel.
Show custom content, instead of a ResultsTable ( you can use this to show for example a Calendar, Dashboard or whatever you put in your DataObject).

Obeys canView, canEdit, canDelete and canCreate on each record instead of only the complete set (i.e. hide rows that authors are not allowed to see, or limit the amount of records they can create).

There are still some little refinements to do, but on a custom NewsLetter and Webshop module it works solid.

You can checkout the module from svn on:

A sample implementation can be found on:

Or download attached files

I would like to know what you think of it and if you have any improvements let me know!

Attached Files

29 September 2010 at 10:33pm Forum Moderator, 1796 Posts

this is very nice, thanks Martijn


2 October 2010 at 2:27am Community Member, 16 Posts

HI Martijin,
Can u attach the ppt, it looks very interesting.


5 October 2010 at 4:59pm Forum Moderator, 51 Posts

I've come across this module after hacking about trying to extend LeftAndMain and ModelAdmin, thanks heaps Martijn!


5 October 2010 at 8:19pm (Last edited: 5 October 2010 8:21pm), Community Member, 271 Posts

@CoconutDrink : Can't you see the slideshare ? Anyway, see attached file.

@frankmullenger : Thanks. Hope it is useful!

Attached Files

11 November 2010 at 4:08pm Forum Moderator, 51 Posts

Hey Martijn, regarding that known issue of: Sometimes the wrong buttons are displayed in the ResultsForm and EditForm.

I'm finding that after an AJAX request has been processed, such as clicking to view the next 10 results of objects, if I click to edit an object the save, delete and back buttons are hidden - by some javascript I think.

When I click to edit a record in the first 10 results without clicking to view the next 10 results or triggering an AJAX call like that, the buttons display correctly. I couldn't easily find where the buttons were being hidden, hope that helps though.


19 November 2010 at 2:25am Community Member, 288 Posts

Just trying this out. I'm using both the panelmodeladmin and the productadmin running on the latest branches/2.4. When trying to add a new customer I get this error.

ERROR [User Error]: Couldn't run query:
SELECT "OrderItem"."ClassName", "OrderItem"."Created", "OrderItem"."LastEdited", "OrderItem"."Title", "OrderItem"."ProductID", "OrderItem"."ID", CASE WHEN "OrderItem"."ClassName" IS NOT NULL THEN "OrderItem"."ClassName" ELSE 'OrderItem' END AS "RecordClassName"
FROM "OrderItem"
WHERE ("ParentID" = 2)

Unknown column 'ParentID' in 'where clause'


20 November 2010 at 1:22am Community Member, 271 Posts

@frankmullenger, @Smurkas :I will take a look at it next week!

Go to Top