Jump to:

5453 Posts in 1674 Topics by 1198 members

Customising the CMS

SilverStripe Forums » Customising the CMS » ModelAdmin top menu

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

Page: 1
Go to End
Author Topic: 742 Views
  • bartvanirsel
    Avatar
    Community Member
    88 Posts

    ModelAdmin top menu Link to this post

    Why does the silverstripe CMS demo show a select box on top of

    http://demo.silverstripe.com/admin/payables/

    And how is this done?

    I always get tabs on top of the modeladmin defined in $managed_models.

  • swaiba
    Avatar
    Forum Moderator
    1769 Posts

    Re: ModelAdmin top menu Link to this post

    add the following to your ModelAdmin...

    public function SearchClassSelector() {return "dropdown";}

    you could go to town and edit/override cms\templates\Includes\ModelAdmin_left.ss

    <% if SearchClassSelector = fixeddropdown %>
    <p id="ModelClassSelector">
    <select size=$getModelForms.TotalItems style="font-size:14px; width: 250px; overflow:none" scrollbars="none" >
    <% control ModelForms %>
    <option style="font-size:14px;" value="{$Form.Name}_$ClassName">$Title</option>
    <% end_control %>
    </select>
    </p>
    <% end_if %>

    then use...

    public function SearchClassSelector() {return "fixeddropdown";}

  • bartvanirsel
    Avatar
    Community Member
    88 Posts

    Re: ModelAdmin top menu Link to this post

    Hi swaiba,

    Thanks for the tips. It works!
    Is there a place where things like this are documented?

  • swaiba
    Avatar
    Forum Moderator
    1769 Posts

    Re: ModelAdmin top menu Link to this post

    I had opened a ticket to suggest them, and I do every so often consider finally releasing a module of model admin improvements...

    742 Views
Page: 1
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.