Jump to:

17452 Posts in 4473 Topics by 1971 members

Archive

SilverStripe Forums » Archive » ModelAdmin

Our old forums are still available as a read-only archive.

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

Page: 1 2 3
Go to End
Author Topic: 3788 Views
  • Fuzz10
    Avatar
    Community Member
    786 Posts

    Re: ModelAdmin Link to this post

    Hmm, odd.

    Works for me ...

    Although I have only used a very simple data-object class ....

  • UncleCheese
    Avatar
    4085 Posts

    Re: ModelAdmin Link to this post

    Would you mind posting all of your relevant code?

  • Fuzz10
    Avatar
    Community Member
    786 Posts

    Re: ModelAdmin Link to this post

    Sure, no problem... ;-)

    Data-class :

    class Bestelling extends DataObject {

    static $db = array(
       'BestelNummerID' => 'Int',
       'BestellingText' => 'HTMLText'
    );

    static $searchable_fields = array(
    'BestellingText' => 'PartialMatchFilter'
    );

    And the modeladmin class

    class AdminBestelling extends ModelAdmin
    {
    protected static $managed_models = array (
    'Bestelling'
    );

    static $url_segment = 'beheer';
    static $menu_title = 'Bestellingen';
    }

  • UncleCheese
    Avatar
    4085 Posts

    Re: ModelAdmin Link to this post

    I suddenly feel really stupid. This isn't bundled with the 2.2.3 release, is it? I can't find a ModelAdmin class anywhere in my filesystem. Is it something I can only get from the trunk?

  • Fuzz10
    Avatar
    Community Member
    786 Posts

    Re: ModelAdmin Link to this post

    ;-)

    Hhaa.. indeed , you need to download the latest trunk release (2.3)...

  • Ingo
    Avatar
    Forum Moderator
    801 Posts

    Re: ModelAdmin Link to this post

    Good to see some interest in ModelAdmin, we found it to be a quite handy tool for quick data entry, prototyping as well as fully fledged admin interfaces. You're right, there's very little documentation on it, I'll try to extend http://doc.silverstripe.com/doku.php?id=modeladmin before the final 2.3 release (see http://open.silverstripe.com/ticket/3172)

  • Apophenian
    Avatar
    Community Member
    46 Posts

    Re: ModelAdmin Link to this post

    Sorry to hijack this thread, but does the $searchable_fields array impact the front end search in any way, or is it just restricted to the admin area?

  • Ingo
    Avatar
    Forum Moderator
    801 Posts

    Re: ModelAdmin Link to this post

    The SearchForm class currently doesn't use DataObject::$searchable_fields, thats still on the list - but there's nothing keeping you from implementing your own SearchContext in the frontend generally.

    3788 Views
Page: 1 2 3
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.