Is it possible in SharePoint Designer 2013 to find the web part templates and wrap identifier div:s around them so I know what they are?

For example if I have a library web part and want to make them all blue, there seems to be no class that groups them in this way, however if I could wrap a div around the library template then I could achieve this.


What you could do, is to use for example jQuery. There are elements lower down in the structure that has unique (well unique for all List View Webparts) classes.



That code adds the class tada-listview-webpart to the most outer element of a List View Webpart.

By running this code after the rendering of the List View Webpart, you have successfully added a class and thereby can add styling to the webpart by the class name :)

Example of running after load of sp.js:

}, 'sp.js');

Not one hundred percent sure that sp.js is the script you need to run after, but you can see the load order in the developer tools of a browser, and try the scripts one by one until it works.

| improve this answer | |
  • For example in a Content Editor Webpart, or if you have a custom masterpage, you can add a <script> there. Note that you will need to add jQuery for using my code. Btw, a thanks is usually connected to an upvote ;) – Robert Lindgren Aug 5 '13 at 14:03

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.