1

Basically like the title states, I have a subsite with a Calendar App part and would like to add it onto the landing page of my root site. If this can't be done I'm wondering of the opposite can, can I add a Calendar App of a parent site to a subsite?

I've tried using SharePoint Designer and just copying and pasting out the section but received an error saying the list does not exist.

I'm also unable to get it to work from saving the web part as a file and then uploading into my root site.

Any help is appreciated

1 Answer 1

1

When you copy/paste the code in Designer, before you save it, change the WebId portion to the web id from which the calendar comes from:

enter image description here

Did not realize how small the picture was going to be. In the <WebPartPages:XsltListViewWebPart> opening tag, you'll find the attribute for WebId.

Before being changed, it should be 00000000-0000-0000-0000-000000000000.

You can get your web id by following Shrout1's answer here: http://social.msdn.microsoft.com/Forums/en-US/6b30982d-4be0-43a2-b80b-f2bad398c28e/what-is-the-easiest-way-to-get-a-web-id

For convenience, here is the code he used, just add it to a content editor web part:

<script language="javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js" type="text/javascript"></script><script type="text/javascript">
function GetSPWebID()
{
    url = document.getElementById("field1").value;
    var webId;

var soapEnv =
"<?xml version='1.0' encoding='utf-8'?>\
    <soap:Envelope xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:xsd='http://www.w3.org/2001/XMLSchema' xmlns:soap='http://schemas.xmlsoap.org/soap/envelope/'>\
<soap:Body>\
<GetWeb xmlns='http://schemas.microsoft.com/sharepoint/soap/'>\
</GetWeb>\
</soap:Body>\
</soap:Envelope>";
    $.ajax({
        url: url + "/_vti_bin/SiteData.asmx",
        beforeSend: function(xhr) {xhr.setRequestHeader("SOAPAction", "http://schemas.microsoft.com/sharepoint/soap/GetWeb");},
        type: "POST",
        data: soapEnv,
        dataType: "xml",
        async: false,
        complete: function(xData, status) {webId = $(xData.responseXML).find('WebID').text();},
        contentType: "text/xml; charset='utf-8'"
      });
document.getElementById("field2").value=webId;
}</script>Root Web URL: <input id="field1"/><br/>WebID: <input id="field2"/> <br/><br/><button onclick="GetSPWebID()">Get Web ID</button> 
//nonsense comment to keep IE7 from truncating MSDN code

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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