Sunday, March 29, 2015

SharePoint 2013: How to hide All Day Event, Recurrence and Category fields from Calendar New Item form

Using Content Editor Web part and JQuery, you can easily hide the unwanted fields like All Day Event, Recurrence, Category fields from SharePoint Calendar new item form.
  • Navigate to the SharePoint Calendar in SharePoint site where you need to remove the fields.
  • From ribbon, Click on Calendar tab
  • In Customize list section of Calendar ribbon, click on arrow besides Form Web Part. You will see three forms named Default New form, Default Display form and Default Edit form. Click on Default New form.
  • In Default New form edit page, click on Add a Web Part and select the Content Editor Web part.
  • From Content Editor Web part, Click on Click here to add new Content
  • Now select Edit Source from ribbon and add java script to HTML Source editor to hide the fields from calendar form and click OK. To hide exact field, you can start count of TR from Title field as 0 and update the number in java script.
you can also use following scripts to hide fields:

 <script src="//code.jquery.com/jquery-1.11.0.min.js"></script>
 <script type="text/javascript">
 $(document).ready(function()
 {
 $('nobr:contains("All Day Event")').closest('tr').hide();
 $('nobr:contains("Recurrence")').closest('tr').hide();
 });
 </script>

Reference: https://hpatel.wordpress.com/2014/06/05/sharepoint-2013-how-to-hide-all-day-event-recurrence-and-category-fields-from-calendar-new-item-form/

Change the default tile size/tumbnails view in image library in Sharepoint 2013


Using a CSS only approach, add the following CSS inside the content editor webpart or add it to your custom css.

<style type="text/css">
            div.ms-promlink-body {
                height: 130px;
            }
            div.ms-tileview-tile-root {
                height: 150px !important;
                width: 150px !important;
            }
            div.ms-tileview-tile-content, div.ms-tileview-tile-detailsBox,  div.ms-tileview-tile-content > a > div > span {
                height: 140px !important;
                width: 140px !important;
            }
            div.ms-tileview-tile-content > a > div > img {
                max-width: 100%;
                width: 100% !important;
            }

            ul.ms-tileview-tile-detailsListMedium {
                height: 100px;
                padding: 0;
            }
            li.ms-tileview-tile-descriptionMedium {
                font-size: 11px;
                line-height: 16px;
            }
            div.ms-tileview-tile-titleTextMediumExpanded, div.ms-tileview-tile-titleTextLargeCollapsed, div.ms-tileview-tile-titleTextLargeExpanded {
                padding: 3px;
            }
             div.ms-tileview-tile-titleTextMediumCollapsed {
                font-size: 12px; !important;
                padding-left: 6px; !important;
            }
             li.ms-tileview-tile-descriptionMedium {
                font-size: 11px;
                line-height: 14px;
                padding: 3px;
            }
           
</style>