Jump to:

5450 Posts in 1672 Topics by 1197 members

Customising the CMS

SilverStripe Forums » Customising the CMS » ModelAdmin Tab labels for left hand menu

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

Page: 1
Go to End
Author Topic: 1840 Views
  • squared99
    Avatar
    Community Member
    12 Posts

    ModelAdmin Tab labels for left hand menu Link to this post

    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

  • Hamish
    Avatar
    Community Member
    712 Posts

    Re: ModelAdmin Tab labels for left hand menu Link to this post

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

    ...

  • squared99
    Avatar
    Community Member
    12 Posts

    Re: ModelAdmin Tab labels for left hand menu Link to this post

    Perfect.

    Thanks Hamish

  • dvp
    Avatar
    Community Member
    4 Posts

    Re: ModelAdmin Tab labels for left hand menu Link to this post

    That about make $singular_name and $plural_name translateable?

    1840 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.