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.

Archive /

Our old forums are still available as a read-only archive.

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

Remove/Hide Newsletters Tab in CMS


Go to End


6 Posts   2346 Views

Avatar
Teng

Community Member, 11 Posts

22 September 2008 at 7:37pm

Hi,

I'm trying to hide the Newsletters section from view in the CMS itself, any idea's how to go about this?

Avatar
Phalkunz

Community Member, 69 Posts

22 September 2008 at 8:01pm

Edited: 22/09/2008 8:01pm

LeftAndMain::remove_menu_item('newsletters');

Avatar
Willr

Forum Moderator, 5523 Posts

22 September 2008 at 8:24pm

Edited: 22/09/2008 8:25pm

What Phalkunz suggested will only work on the trunk version of the code. If you are using 2.2.2 or any other stable release > 2.2.2 you have to do

// Remove the option of 'Newsletters' in the CMS for SS <2.3
Object::addStaticVars('LeftAndMain', array(
	'removed_menu_items' => array(
		'newsletter'
	)
));

* Add this to your mysite/_config.php file FYI

Just another example of why 2.3 is going to be nice as this way is a bit meh.

Avatar
Teng

Community Member, 11 Posts

22 September 2008 at 8:27pm

Where would I put that? In my actual project? I'm just working off the tutorial currently and tried it in the page controller which it didn't seem to like, please forgive my nubness :)

Avatar
Teng

Community Member, 11 Posts

22 September 2008 at 8:32pm

thanks willr :) worked great!

Avatar
Phalkunz

Community Member, 69 Posts

22 September 2008 at 8:58pm

@will: I totally forgot about it :p thanks for correcting