Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I'm working on a Sharepoint 2010 project where I'm required to offer functionality for the end user to change the styles of web parts on an individual basis.

How would I go about adding a new setting (potentially a dropdown) so the user can change the colour of any type of web part added to a page. My initial thought would be to display this in the web part properties but I suppose it could be added to the ribbon if that's easier.

Is it possible to do this so that any web part will have this new option?

Any suggests appreciated

Thanks

share|improve this question
    
Where would you want to have this setting? In the Web Part Settings dialog or would you develop something custom? –  Eric Herlitz Oct 10 '12 at 6:40
    
Web part settings seems like the most logical place. –  user1162591 Oct 10 '12 at 8:26
add comment

migrated from stackoverflow.com Oct 11 '12 at 12:19

This question came from our site for professional and enthusiast programmers.

1 Answer

When it comes to this kind of adaptations the storage of the custom data that should be personal is the tricky part.

I'd create a custom list capable to contain the settings you want to change. If you have a lot of different settings in a lot of different webparts one settings list will most likely not be an option, in such case you may have to create a setting list for each web part.

  • If a user haven't made any customizations always ensure there are fallback values

I'd say the rest if fairly simple. Le me know if you need any help.

share|improve this answer
    
I agree with your suggestion of using a list and to be honest, there will only be one setting so that should be fairly straight forward. I guess where my knowledge lacks is the implementation within the web part settings - how do I go about adding new custom code that all web parts will inherit? –  user1162591 Oct 10 '12 at 8:28
    
If you are going to have a property setting (like background-color) that all web parts on a site shall inherit the property must be stored centrally. Having this setting as a web-part setting is pretty simple. If this is what you want I may have the time to write an example in a few hours but please confirm that my assumption is correct :) –  Eric Herlitz Oct 10 '12 at 12:07
    
Yes this is exactly what I'm looking for - a global setting across all web parts. The idea is to then set a class on the selected web part to change it s colour. Many thanks for your help :-) –  user1162591 Oct 10 '12 at 12:42
1  
Just to add - this doesn't need to be personalisable on a per-user level - it will only be configured by admin and standard users will see the selected style. –  user1162591 Oct 10 '12 at 13:31
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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