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.

Customising the CMS /

ModelAdmin Tab labels for left hand menu


Reply


4 Posts   1983 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, 4 Posts

14 December 2009 at 8:49am

That about make $singular_name and $plural_name translateable?