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   1947 Views

Avatar
squared99

26 November 2009 at 11:33am Community Member, 12 Posts

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

26 November 2009 at 12:48pm Community Member, 712 Posts

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

27 November 2009 at 11:50am Community Member, 12 Posts

Perfect.

Thanks Hamish

Avatar
dvp

14 December 2009 at 8:49am Community Member, 4 Posts

That about make $singular_name and $plural_name translateable?