0

I have added the same calendar twice to a web page as web parts and i have used the target audience options to limit access to certain groups. but what i need to do is hide or disable the option for users to change to different calendar views. even if possible hide calendar ribbon completely(see image below, i want to disable or hide this option from users). i tried adding the following java script but this hides everything including the calendar

 <style>

     #ms-designer-ribbon {
         visibility: hidden;
     }

 </style>

view option and calendr ribbon

Robert Lindgren
  • 24,520
  • 12
  • 53
  • 79
derek
  • 307
  • 1
  • 3
  • 14

1 Answers1

2

Try the following CSS:

/* Hide Calendar Ribbon Body */
#RibbonContainer ul[id$="Calendar"] {
    display: none !important;
}

/* To hide Calendar Ribbon tab */
#RibbonContainer li[id$="Calendar-title"] {
    display: none !important;
}

You can add the above CSS either to the Script Edito/Content Editor web part or embed into the page.

Aveenav
  • 4,199
  • 1
  • 14
  • 13
  • thanks Aveenav, that's exactly what i needed, works perfect. quick and simple solution. this is a great way to restrict users from accessing calendar views – derek Jan 30 '16 at 16:14
  • You're welcome. In addition to using CSS, you can also hide/remove the elements using JavaScript. See some great suggestions here: http://sharepoint.stackexchange.com/questions/116001/hide-disable-ribbon-bar-buttons-with-client-side-code/116016#116016 – Aveenav Jan 30 '16 at 16:48