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 /

Not show CMS menu


Reply


2 Posts   488 Views

Avatar
Benas

Community Member, 7 Posts

3 April 2012 at 9:16am

Hi!

I`m making a modole and have problem with adding title to CMS menu.
my _config.php code:

<?php
Object::addStaticVars('LeftAndMain', array(
   'extra_menu_items' => array(
      'Random Links' => 'admin/randomlinks/',
   )
));

Director::addRules(100, array(
   'admin/randomlinks/$Action/$ID' => 'RandomLinksAdmin',
));

Whats wrong?

Thanks!

Avatar
zenmonkey

Community Member, 528 Posts

12 April 2012 at 3:06am

If your module needs to add another function to the menu it may be easier to just have it extend ModelAdmin as that automatically creates your top menu items
http://doc.silverstripe.org/sapphire/en/reference/modeladmin

unless you're not using this to actually manipulate a dataobject then you need to extend LeftAndMain and build out your custom interface
http://doc.silverstripe.org/sapphire/en/reference/leftandmain