Change Web Part properties in page tab

Mateusz Żebrowski asked on October 13, 2015 15:28

If I'd like to allow Editor to change some web part properties but I don't want create a widget zone (because I don't want Editor to customize it - add, delete widgets etc.) should I create editable web part? If not what is the solution?

Correct Answer

Brenden Kehren answered on October 14, 2015 01:16

Webpart properties are specific per template not a page. So if your editor is editing this content per page you'd need to work out some kind of widget.

OR within a custom webpart create a placeholder that holds your UI to select the property values and work with the ViewMode enum to set the visibility of the UI placeholder. You will have to store those values as you normally would.

Not saying this will work for what you're doing but it's a start. As I mentioned, if you allow the editor to make a change to the webpart's properties, this will be template wide and not just for a specific page so be careful.

1 votesVote for this answer Unmark Correct answer

Recent Answers

Mateusz Żebrowski answered on October 14, 2015 08:17

Ok I think you are right, it's not the best solution. I'm not sure but I can't allow editors to edit widget and deny adding, deleting and moving them, right? So there isn't any optimal way to solve the problem and I should decide to work with web parts or to work with widget zones?

0 votesVote for this answer Mark as a Correct answer

David te Kloese answered on October 14, 2015 13:13


Not sure if this works in your use case. But you could create a webpart that reads its properties from somewhere else (custum via code, or via macro's from current document).

For example settings on the form tab of current page (so extra properties on the page type). If its a lot of properties or needs to be reused you could let them select a document somewhere else specifically made for this type.

Since its a webpart you are in control of which settings they can edit and which not. You can even add a show/hide button to make it disappear.



0 votesVote for this answer Mark as a Correct answer

Brenden Kehren answered on October 14, 2015 14:14

Mateusz what I would do then would create a UI piece within your webpart and set the visibility of it based on the roles you specifiy and if the ViewMode != live site or preview. Then the user has access to modify those properties from the UI without needing access to other places in the website.

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.