If you would like to change this image for each new Document Set added to a library, then upload a picture somewhere in SharePoint and then while viewing the new Document Set, click the Page ribbon, Edit Page and then edit the image web part. No fun if you have to do this for each new Document Set folder added to the library.
Make it Dynamic
What if you wanted the picture to be more automatic, or updateable by the users of the Document Set who might not have the permissions to edit the page?Here's the plan:
- Let the users of the Document Set upload a picture to the Document Set. We will pick a required named like "TeamLogo.png".
- Modify the original Content Type in Site Settings, or modify the copy of that Content Type that is already associated with the library. (Content Types are copied to a library.)
- Add a Content Editor Web Part just below the existing Image Web Part.
- Add JavaScript to change the URL of the Image Web Part's HTML to point to our picture.
The steps below assume you have already created your custom Document Set Content Type.
- Go to Site Settings and Site Content Types and click the Content Type,
or
Go to the library, visit Library Setting and click the Content Type. - Click Document Set Settings.
- Scroll down and click Customize the Welcome Page.
- In the ribbon click PAGE and Edit Page.
- Click below the Image web part (but still in Zone 1).
- Click the INSERT ribbon and click Web Part.
- In the Media and Content section click Content Editor and the click Add.
- If the web part did not go below the Image web part:
- In the Content Editor Web Part click the dropdown arrow and click Edit Web Part.
- Expand Layout, change the Zone Index from 0 to 1 and click Apply.
- In the Content Editor Web Part click "Click here to add new content".
- Click the FORMAT TEXT ribbon and click Edit Source.
- Add the JavaScript from below.
- Replace "\\myimage.png" filename with something better like "\\teamlogo.pgn" or \\projectlogo.prg.
- Click OK and then APPLY. (no image will display while in the page editor)
- Click the PAGE ribbon and click Stop Editing.
- If you just created a new Content Type, go create a new library and add this Content Type to the library.
- In your library that is using this Content Type:
The JavaScript code.
<script> // get the page's URL var url = window.location.href; // make sure we are not in page edit mode if(url.indexOf("RootFolder")>0) { // get the "RootFolder" query string parameter var rootpath = url.split("RootFolder=")[1].split("&")[0]; // build a URL to our image file. Replace "myimage.png" with something // better like "\\teamlogo.pgn" or "\\projectlogo.prn" var imgpath = "..\\..\\.." + rootpath.replace(/%2F/g, "\\") + "\\myimage.png"; // update the image source // Note that the ID is for the default doc set image web part. Yours // may be different! document.getElementById("MSOImageWebPart_WebPartWPQ2").src=imgpath; } </script>...