21286 Posts in 5733 Topics by 2602 members
|Go to End|
21 September 2010 at 1:52am
I have a ModelAdmin where I need to change the name that appears in CMSMenu, but I cannot just change the...
static $menu_title = 'MyAdminOldName';
...I NEED to find a way of doing it outside of just changing the original static declaration.
I have tried and failed with...
inside a custom leftandmain decorator (does nothing)...
$menu_item = CMSMenu::get_menu_item('MyModelAdmin');//does return the right CMSMenuItem
inside the init function of the extended ModelAdmin (does nothing)...
public function init()
in _config.php (complains about trying to use a database object before the database has been initialised)...
21 September 2010 at 7:43am
Adding a translation to your languagefile will do the trick. Suppose your ModelAdmin class is called MyModelAdmin:
In cms/lang/en_US.php add:
$lang['en_US']['MyModelAdmin']['MENUTITLE'] = 'Some Menutitle';
21 September 2010 at 8:12pm
Now why didn't I think out that... Doh!
Many thanks Martimiz
|Go to Top|