none
How to add multiple Send To options in a document library context menu (dropdown)?

    Question

  • In Advanced, I can add a single Custom Send To Destination. I need more than one. How, where do I add another?

    Thanks!


    • Edited by Benhennyd Tuesday, February 28, 2012 11:59 PM
    Tuesday, February 28, 2012 11:55 PM

Answers

  •  Hi,

    You can use JavaScript to add ECB menu items to achieve this. Open your document library and add a Content Editor Web Part to the bottom of the page. Copy the code below into Source Editor.

    <script type="text/javascript">

    ctx.SendToLocationName2="sub4documents";

    ctx.SendToLocationUrl2="http://come:100/sites/collection1/sub4/Shared Documents";

    function Custom_AddDocLibMenuItems(m,ctx){

    var sm1=CASubM(m, "sendto","","",400);

    var strAction="STSNavigate('"+ctx.HttpRoot+"/_layouts/copy.aspx?"+"SourceUrl="+escapeProperly(GetAttributeFromItemTable(itemTable, "Url", "ServerUrl"))+"&Source="+GetSource()+"&FldUrl="+escapeProperly(ctx.SendToLocationUrl2)+"')";

    CAMOpt(sm1,ctx.SendToLocationName2,strAction,"");

    }

    </script>

    Note: remember to replace the value of ctx.SendToLocationUrl2 with your destination library.

    The code above create a new ECB menu item named sendto, the sub4documents will show as a sub item in sendto. If you want more custom destination, just add some code like above.

    Thanks.


    Emir Liu

    TechNet Community Support

    • Marked as answer by Benhennyd Wednesday, February 29, 2012 5:06 PM
    Wednesday, February 29, 2012 9:51 AM

All replies

  •  Hi,

    You can use JavaScript to add ECB menu items to achieve this. Open your document library and add a Content Editor Web Part to the bottom of the page. Copy the code below into Source Editor.

    <script type="text/javascript">

    ctx.SendToLocationName2="sub4documents";

    ctx.SendToLocationUrl2="http://come:100/sites/collection1/sub4/Shared Documents";

    function Custom_AddDocLibMenuItems(m,ctx){

    var sm1=CASubM(m, "sendto","","",400);

    var strAction="STSNavigate('"+ctx.HttpRoot+"/_layouts/copy.aspx?"+"SourceUrl="+escapeProperly(GetAttributeFromItemTable(itemTable, "Url", "ServerUrl"))+"&Source="+GetSource()+"&FldUrl="+escapeProperly(ctx.SendToLocationUrl2)+"')";

    CAMOpt(sm1,ctx.SendToLocationName2,strAction,"");

    }

    </script>

    Note: remember to replace the value of ctx.SendToLocationUrl2 with your destination library.

    The code above create a new ECB menu item named sendto, the sub4documents will show as a sub item in sendto. If you want more custom destination, just add some code like above.

    Thanks.


    Emir Liu

    TechNet Community Support

    • Marked as answer by Benhennyd Wednesday, February 29, 2012 5:06 PM
    Wednesday, February 29, 2012 9:51 AM
  • Thank you - it added a new item to the context menu but not the actual Send To options. So I'll need to create my own Send To? And if I want two or three in there, how do I do that?
    • Edited by Benhennyd Wednesday, February 29, 2012 5:14 PM
    Wednesday, February 29, 2012 5:06 PM
  • OK - figured out how to do multiple, and if I had more, I'd create an array and loop it. But I still can't see how to get these into the standard "Send To" menu.

    <script type="text/javascript">
    ctx.SendToLocationName2="Markup";
    ctx.SendToLocationName3="Published";
    ctx.SendToLocationUrl2="http://myloc.com:20583/sites/mysite/Markup";
    ctx.SendToLocationUrl3="http://fmylo.com:20583/sites/mysite/Published/";
    function Custom_AddDocLibMenuItems(m,ctx){
    	var sm2=CASubM(m, "Send To","","",400);
    	var strAction2="STSNavigate('"+ctx.HttpRoot+"/_layouts/copy.aspx?"+"SourceUrl="+escapeProperly(GetAttributeFromItemTable(itemTable, "Url", "ServerUrl"))+"&Source="+GetSource()+"&FldUrl="+escapeProperly(ctx.SendToLocationUrl2)+"')";
    	var strAction3="STSNavigate('"+ctx.HttpRoot+"/_layouts/copy.aspx?"+"SourceUrl="+escapeProperly(GetAttributeFromItemTable(itemTable, "Url", "ServerUrl"))+"&Source="+GetSource()+"&FldUrl="+escapeProperly(ctx.SendToLocationUrl3)+"')";
    	CAMOpt(sm2,ctx.SendToLocationName2,strAction2,"");
    	CAMOpt(sm2,ctx.SendToLocationName3,strAction3,"");
    }
    </script>
    I suppose if I could find the actual name of the standard "Send To" menu in the CASubM function, I could put it there. I know it isn't "Send To".
    Wednesday, February 29, 2012 6:17 PM
  • I also have an unintended feature with this. When I add a Content Editor Web Part to the page, my library and page tabs disappear from the top of the page - as though I don't have the correct permissions. I remove the web part, and the reappear.

    Any ideas why this is happening?

    Friday, March 02, 2012 5:04 PM