SharePoint Calendar does not show when in a page as a webpart

SharePoint Calendar does not show when in a page as a webpart

So I was asked to add an events calendar to a SharePoint site that is being used as a portal. This would display the calendar as a WebPart on a SharePoint Wiki page.

But, obviously, as with anything SharePointy, this wasn’t as straight forward as just sticking the WebPart in. The issue I encountered was the events were not showing when it was inserted as a WebPart.

After much use of Google and asking specialists in SharePoint I was coming up blank. I did find that it was due to a JavaScript issue. To fix the issue, I had to open the page which the calendar was displayed on in SharePoint designer and add the following code:

<script type=”text/javascript”>
SP.SOD.executeOrDelayUntilScriptLoaded(function () {
SP.UI.ApplicationPages.ElementUtility.$3f = function ($p0) {
return ($p0.substring(0, 3).toUpperCase() == “WPQ”)
? $get(‘WebPart’ + $p0)
: $get($p0);
}
}, “SP.UI.ApplicationPages.Calendar.js”);
</script>

This over-rides the default JavaScript in the Wiki page, job done.

Please Login to Comment.

Notice for AdBlock users

Please support this website by adding us to your whitelist in your ad blocker.

Ad-revenue is vital for the upkeep of this site, expenses incurred include time to manage the site, hosting and domain name. You can also support this site by donating and/or registering for goPro.

With goPro you will not see any ads.

Your assistance is appreciated.

Gary