I was working on one stuff and suddenly a question came from one of my friends that is there any way where in I can prevent users from adding web part to web part zone, however they can certainly change the web part’s property and all.
So I tried something and found out the answer. Easy answer is in the SharePoint designer and other answer is the feature file for that web part.
Open the SharePoint designer; connect to the site and the page where that web part is. Move your mouse cursor to the area of the web part zone. Right click the area, and select web part zone properties and you will find something like this
Here you can unselect the first option which will prevent any user to add any more web parts to the web part zone.
Save the page, although page will become customized, however this method solves the purpose.
The other approach is simple in the manifest file, add one allowlayoutchange="false" attribute to the web part zone tag in xml file.
I hope this will help many.
No comments:
Post a Comment