Forum Discussion
Malene Friborg
Feb 20, 2018Iron Contributor
calendar web part on modern pages
Any chance we can get an ordinary calendar web part on our modern pages?
Events web part is not enough and the group calendar is only for, well, groups :-) We have the need for a modern page with ...
YuliyaHarada
Microsoft
Feb 23, 2018hi Malene,
You can workaround this by adding an embed webpart to your modern page with this iframe code:
<iframe width="100%" height="1000px" src="https://xxx.sharepoint.com/sites/xxx/Lists/Calendar/calendar.aspx" scrolling="no" style="margin-left: -200px; margin-top: -190px;">
</iframe>
You can workaround this by adding an embed webpart to your modern page with this iframe code:
<iframe width="100%" height="1000px" src="https://xxx.sharepoint.com/sites/xxx/Lists/Calendar/calendar.aspx" scrolling="no" style="margin-left: -200px; margin-top: -190px;">
</iframe>
- Joy_StantecJan 18, 2019Copper Contributor
Hi! I have been using this code to embed my calendars. Last week it magically stopped working and now the left and top nav that should be cut off with the margins are showing.
Any idea how to fix this and/or why it changed? No code changed on my pages. One minute the iframe margins worked, and the next time I opened the page, the iframe margins weren't working anymore.
- georg1Jan 24, 2019Brass Contributor
I'm having this exact problem with my calendar. I'm yet to try the script solution posted here, but I found an interim solution on reddit which may help some here:
Add ?isdlg=1 or &isdlg=1 to the end of your embedded address/URL. This popped up a bit of a spacey calendar, but it's better than the whole page. Hopefully Microsoft fixes this problem properly soon.
- Josef HermesMay 27, 2019Copper Contributor
georg1 many thanks! This indeed did the job for us. So, in summary: we used the embed webpart with this iframe code:
<iframe src="https://company.sharepoint.com/sites/yoursite/Lists/agenda/calendar.aspx?isDlg=1" width="100%" height="800px"></iframe>
- JHMSTechCommJan 18, 2019Copper Contributor
Below is an answer I received from Microsoft on a modification to the javascript in order to display the calendar in a better manner. I didn't want to modify the code for something that is fairly trivial for me so I can't say if this works or not. I also asked them what changed in the last week or so and they didn't have a response for that.
Microsoft Answer:
If only want to display the calendar in the modern experience page like this,
You can try these below steps,
- On the calendar page(which you want to display on the modern page), edit the page, add one content edit web part and insert below JavaScript code in the content edit web part,
<script>
function HideElementInFrame(Id)
{
ele = window.document.getElementById(Id);
if(ele)
{
ele.style.display="none";
}
}
var url = new URL(window.document.location.href);
var IsInIframe = url.searchParams.get("IsInIframe");
if(IsInIframe==1)
{
HideElementInFrame('s4-ribbonrow');
HideElementInFrame('s4-titlerow');
HideElementInFrame('zz12_V4QuickLaunchMenu');
HideElementInFrame('zz11_RootAspMenu');
HideElementInFrame('DeltaPlaceHolderSearchArea');
HideElementInFrame('suiteBarTop');
}
</script>
2. On the modern page, embed the calendar page with below code,
<iframe src="https://yourcompany.sharepoint.com/calendar.aspx?IsInIframe=1" scrolling="no" width="100%" height="1000px">
</iframe>
- MahmudaJan 03, 2020Copper Contributor
Hi Josh, JHMSTechComm
I am also attempting to get the full view of the calendar on to my modern SharePoint site. Once I click Edit Page, I do not see the Edit Source button to edit/enter a JavaScript code under HTML Source. See image below. Please let me know if I am missing a step?
Thanks,
Mahmuda
- Robert CondasJan 09, 2019Brass Contributor
I was using this on my Modern page in SharePoint and it worked fine, but yesterday something changed and now this is not working as before. Now I see the entire Calendar site, not just the calendar itself. It's like having a screenshot of the entire calendar site on my Modern page, and I can no longer use it when it does this. Did this happen to anyone else yesterday?
Thanks!
- Joy_StantecMay 27, 2019Copper Contributor
Robert Condas I'm still having this same problem. I noticed the switch back in January as well. Has anyone figured out why the display isn't working correctly? (Areas trimmed by the margin styles are still showing.)
Thanks!
- JHMSTechCommJan 09, 2019Copper Contributor
Yeah, something changed in the last day or so and my embedded calendar web part does not display correctly anymore. These are the embed settings I had previously which worked fine:
<iframe src="https://site.sharepoint.com/calendar.aspx" scrolling="no" style="margin-left: -200px; margin-top: -190px;" width="100%" height="1000px">
</iframe>I've played around with the values and am not having any success getting it framed correctly. Appreciate it if anyone has any ideas how to fix this. Thank you.
- Robert CondasJan 09, 2019Brass Contributor
I was using the same thing, hope someone can figure this out as I have found nothing else that provides the SharePoint calendar on a Modern page.
Thanks
- DeletedJan 09, 2019The same thing happened to me yesterday as well. Any idea what the cause for this change might be?
- Robert CondasJan 09, 2019Brass Contributor
Not sure, but am looking into it now. Microsoft may have made a change in the way their Embed web part reads what we embedded. If I can't figure it out I'm going to contact MS and see if they know of any changes they recently pushed out. This is a big issue to me as I was using this on many sites and I had touch every one. Please let me know if you find a cause.
Thanks!
- Michael WolfJul 31, 2018Copper Contributor
YuliyaHarada, there seems to be some space at the bottom that still scrolls. I tried adding the scrolling="no" but that doesn't work. would there be something that crops the bottom of the frame and to prevent it from scrolling. i also tried adding margin-bottom and was not able to get that to function properly as well.
thanks.
- YuliyaHaradaJul 31, 2018
Microsoft
Unfortunately, I haven't been able yet to figure out how to get rid of that extra white space at the bottom...
- Magnus AnderssonApr 26, 2018Copper Contributor
Is it possible to do the same, but get the weekly view instead?
- YuliyaHaradaApr 26, 2018
Microsoft
Yes, you do that by changing the Default Scope in the calendar view settings from Month to Week.
- Donia StrandJun 08, 2018Iron Contributor
I've tried out the embed code, but get a huge amount of space underneath the embedded calendar. Is there some line I can add to the embed code so that there is no space at the bottom of the web part?
- Malene FriborgFeb 27, 2018Iron Contributor
Hi Yuliya,
Thanks for your suggestion. I created the web part page and put on the ordinary calendar web part. It works ok and it is in production now.
I will try our your suggestion next time I need a calendar :-)
Thanks again.