Jump to:

10929 Posts in 2613 Topics by 1809 members

All other Modules

SilverStripe Forums » All other Modules » New Module : Create custom LeftAndMains with PanelModelAdmin

Discuss all other Modules here.

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

Page: 1 2
Go to End
Author Topic: 3548 Views
  • Martijn
    Avatar
    Community Member
    271 Posts

    New Module : Create custom LeftAndMains with PanelModelAdmin Link to this post

    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:

    http://www.slideshare.net/marvanni/panelmodeladmin-example

    Features:

    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:

    http://svn.axyrmedia.com/panelmodeladmin/trunk/

    A sample implementation can be found on:

    http://svn.axyrmedia.com/productadmin/trunk/

    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
  • swaiba
    Avatar
    Forum Moderator
    1784 Posts

    Re: New Module : Create custom LeftAndMains with PanelModelAdmin Link to this post

    this is very nice, thanks Martijn

  • CoconutDrink
    Avatar
    Community Member
    16 Posts

    Re: New Module : Create custom LeftAndMains with PanelModelAdmin Link to this post

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

  • frankmullenger
    Avatar
    Forum Moderator
    51 Posts

    Re: New Module : Create custom LeftAndMains with PanelModelAdmin Link to this post

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

  • Martijn
    Avatar
    Community Member
    271 Posts

    Re: New Module : Create custom LeftAndMains with PanelModelAdmin Link to this post

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

    @frankmullenger : Thanks. Hope it is useful!

    Attached Files
  • frankmullenger
    Avatar
    Forum Moderator
    51 Posts

    Re: New Module : Create custom LeftAndMains with PanelModelAdmin Link to this post

    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.

  • MarcusDalgren
    Avatar
    Community Member
    288 Posts

    Re: New Module : Create custom LeftAndMains with PanelModelAdmin Link to this post

    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)
    LIMIT 10 OFFSET 0

    Unknown column 'ParentID' in 'where clause'

  • Martijn
    Avatar
    Community Member
    271 Posts

    Re: New Module : Create custom LeftAndMains with PanelModelAdmin Link to this post

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

    3548 Views
Page: 1 2
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.