Add link to Document Set in sharepoint with modal dialog

Instances where you wanna create a link to a document set in Sharepoint page, where ootb pages wont give you ….

Add a content editor webpart in the page and add the below code with customizations to the links to it.

<script type=”text/javascript”>
function displayLayover(url) {
var options = SP.UI.$create_DialogOptions();
options.url = url;
options.dialogReturnValueCallback = Function.createDelegate(
null, null);
SP.UI.ModalDialog.showModalDialog(options);
}
</script>

<span class=”s4-clust” style=”width: 10px; height: 10px; overflow: hidden; display: inline-block; position: relative;”><img src=”/_layouts/images/fgimg.png” alt=”” style=”left: 0px !important; top: -128px !important; position: absolute;”/></span> <a href=”javascript:displayLayover(“<linktodocset>”)”>Create New Document Set</a>

 

 

Replace <linktodocset> with your document set link

eg: http://siteurl/_layouts/NewDocSet.aspx?List=GUID&RootFolder=…ContentTypeId=0x0120…

this link can be obtained by right click on the new doc set page and then choose properties and then copy the whole url

 

<span class=”s4-clust” style=”width: 10px; height: 10px; overflow: hidden; display: inline-block; position: relative;”>   — will add + symbol prefixing the text

 

Leave a Reply

Your email address will not be published. Required fields are marked *

Bitnami