- Copy the core.js file from its default location at <%Program files %>common filesMicrosoft sharedweb server extensions12Templatelayouts1033, place it in the same folder, and rename as customcore.js file.
- Make the necessary changes in the customcore.js file by removing unwanted ECB menu items.
- To create the custom master page, make a copy of the default.master page and rename it as custom.master.
- In the custom master page, add the following line to render the customcore.js file:
Save the custom.master page and upload it to the master pages gallery of the site. Then apply the custom.master page as the default master page for the site.
Everything was there! Hold on! – In the 4th step we can see that even though we have our own customcore.js , we still need to add core.js! And that was the ‘thing’ I had missed.
I was under the impression that since my customcore.js is just a copy of core.js, it is enough if we included customcore.js in our master page. But SharePoint doesn’t like that way. We have to render core.js no matter what and then include our own customcore.js. If you don’t do so, then SharePoint will load the default core.js, ignore the customcore.js and you will lose your changes!
So, do not forget the 4th step whenever you hide menu items from the ECB 🙂