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're retiring the forums!

The SilverStripe forums have passed their heyday. They'll stick around, but will be read only. We'd encourage you to get involved in the community via the following channels instead:

Customising the CMS /

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

ModelAdmin Tab labels for left hand menu


Go to End


5 Posts   3251 Views

Avatar
squared99

Community Member, 12 Posts

26 November 2009 at 11:33am

Heya,

Ive looked about a bit but cant see anything in particular about this. Is it possible to control the label that appears in the tabs for the managed_models?

public static $managed_models = array(
'ModelExample'
);

would create a tab labeled Model Example, but what if I wanted to manually specify what the tab label should be?

Cheers

Avatar
Hamish

Community Member, 712 Posts

26 November 2009 at 12:48pm

The name of the object is held in the object as the $singular_name and $plural_name.

So in your case, your ModelExample class should have:

class ModelExample extends DataObject {

   static $singular_name = "Nice Name";

   static $plural_name = "Nice Names";

   ...

Avatar
squared99

Community Member, 12 Posts

27 November 2009 at 11:50am

Perfect.

Thanks Hamish

Avatar
dvp

Community Member, 6 Posts

14 December 2009 at 8:49am

That about make $singular_name and $plural_name translateable?

Avatar
justin_t_brown

Community Member, 22 Posts

7 September 2015 at 8:49am

Thanks for this.