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've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Customising the CMS /

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

ModelAdmin top menu


Go to End


4 Posts   1357 Views

Avatar
bartvanirsel

Community Member, 96 Posts

10 December 2010 at 4:57am

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.

Avatar
swaiba

Forum Moderator, 1899 Posts

10 December 2010 at 5:42am

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";}

Avatar
bartvanirsel

Community Member, 96 Posts

10 December 2010 at 9:10pm

Hi swaiba,

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

Avatar
swaiba

Forum Moderator, 1899 Posts

10 December 2010 at 10:59pm

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