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.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

Customising the CMS /

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

Not show CMS menu


Go to End


2 Posts   1231 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, 545 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