1

Task

  • add ContentSearch WebPart to pagelayout
  • must be unremovable
  • toolpane must be aviable to edit Query and Display Template
  • PageLayout, JS and CSS solution

Approach

The only way to have a WebPart being editable via the UI is to put it in a WebPart Zone. That makes it removable. Only and everything but secure solution is hiding or removing the delete option clientside. -Users who can use the browser devtools would be able to bypass this.


Someone here with a better idea ?

2

There are options on both the webpart zone and webpart itself to block removal. You should check these in SharePoint designer, I think you need designer permission level to modify these values. What permission level are you planning on giving your users?

EDIT Found it:

allowcustomization

allowlayoutchange

allowpersonalization

You can also simply remove the buttons in the webpart properties pane with CSS. But as for a solid solution. Perhaps I'm wrong, but I'm fairly certain this is not possible. Whatever solution you're using on the client side, if the html of the webpart is removed on postback (When the page is saved), it will always delete the webpart from the page (Not to mention that I don't think there's a way of bypassing the webparts maintenance page).

You will need to use a server-side solution if you want to have a 100% solid solution, I don't think there's a way around it.

  • Thanks for your resonse ! Whatever permission is given there should be no option to delete it via the UI. Everyone that is allowed to enter the editmode is only allowed to change the webpart's settings via the toolpane. – Mx. Aug 14 '14 at 9:00
  • Perhaps I'm wrong, but I'm fairly certain this is not possible. Whatever solution you're using on the client side, if the html of the webpart is removed on postback (When the page is saved), it will always delete the webpart from the page (Not to mention that I don't think there's a way of bypassing the webparts maintenance page). You will need to use a server-side solution if you want to have a 100% solid solution, I don't think there's a way around it. – Christoffel de Gruyter Aug 14 '14 at 9:26
  • If the reason why you want a no-code solution is Office 365 or SharePoint Online. You can use a remote event receiver to validate your page content on submit: msdn.microsoft.com/en-us/library/office/… – Christoffel de Gruyter Aug 14 '14 at 9:28
  • I tried every combination of your 3 properties and none resulted in the desired output. Actually I only was able to disable editing at all. So no fixed but editable WebParts - great MS. +1 for covering my results – Mx. Aug 14 '14 at 11:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.