Why add another file? Why not just do this in the LeftAndMainDecorator.php file? It's empty and states that it's there for additional functionality.
Excellent question! It's considered a 'best practice' to avoid modifying the core files so your changes are protected against core updates. With SilverStripe, you update the cms/, jsparty/, and sapphire/ folders to upgrade, so if you've made adjustments to files in these folders they would be lost.
Setting up your own modules to extend core functionality is not that hard to do... the example posted earlier is just a basic demonstration of that principle.
Hope that helps!
Good Point! I didn't think about it from that perspective. I am still relatively new to this CMS (WP and EE switch). I like this A LOT!
Can you tell me how to remove the 'Page Version History' and 'Site Reports' accordion style on the left?
I've been using it for about a year and I'm a big fan!
There is no default config setting for either of these display areas, so you'll need to create a new template to override the existing one. Again, we'll either place this in a module (alphabetically greater than 'cms'), in mysite/, or in your themes/<yourtheme> folder. For the sake of this example, let's use your mysite/ folder.
The template file to override is located at cms/templates/Includes/CMSMain_left.ss, so you'll need to copy this to mysite/templates/Includes/CMSMain_left.ss. At the bottom of this template, you'll see the h2 headings for 'heading_versions' and 'heading_reports'. Just delete everything below these h2 tags that applies (div class="listpane" for each) and save. Then reload your admin with ?flush=1 and you should be good to go!
Let me know how it works out for you.
That worked perfectly!
I like to keep things consistent so I created a 'mysite/templates/Includes' structure like most/all other modules do and placed it there. I like how simple and easy it is to make a change like that...and to separate these changes from the 'Core' files.
Excellent! Glad I could help you out.
Thanks for the info, if you want to remove the Comments section you need to use:
It took me a while to figure out that I had to add Admin behind it. Thought I'd mention it here in case some else is having trouble to find this small detail too.
How can I remove the link to: "Files & Images"?
None of these work:
CMSMenu::remove_menu_item('Files & Images');
CMSMenu::remove_menu_item('Files & ImagesAdmin');