Posts

Showing posts from August, 2014

JQuery: Get Rid off SharePoint Spell Check

Hi Guys, After spending 3-4 hours of struggle, I finally found way to get rid off irritating SharePoint Spell checker. It caught people picker too under the umbrella of spell check, but why, usually it does not required. Well again it may be the requirement. But for my case, I don't want it to watch any of my control on whole site. I tried to navigate to Manage Farm Features > Spell Check feature. Even after deactivating this feature it still working like a stubborn functionality. Then I realized that nothing is impossible for a developer. I have JQuery with me I can hide that control. Resolution: 1) Hiding spell check from the Ribbon: in order to hide the spell check feature to end user, trick that worked for me is to add following line in my custom js: $('a:has(img[src*="images/spellingHH.png"])').parents("li").hide(); 2) Exclude fields from the spell check feature: I have created follwoing method to exclude people picker and other inputs fields fro

Powershell: Change Like and comments settings of a library

Hi, Recently I was working on the requirement to enable the like and comments settings of any library. So I prefer to use PowerShell script for same. I am sharing the code as below: function Change-SettingsForLikeComment() { # Change page library settings for Likes and comments $list=$web.Lists["Pages"]; if($list -ne $null) { Write-Host $list.Title "not null"; $assembly=[System.Reflection.Assembly]::Load("Microsoft.SharePoint.Portal, Version=15.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c") $reputationHelper =$assembly.GetType("Microsoft.SharePoint.Portal.ReputationHelper"); $bindings = @("EnableReputation", "NonPublic", "Static"); [System.Reflection.BindingFlags]$flags = [System.Reflection.BindingFlags]::Static -bor [System.Reflection.BindingFlags]::NonPublic; $methodInfo = $reputationHelper.GetMethod("EnableReputation", $flags); #For enabling Ratings #$values = @($list, "Ratings", $fa

Powershell: Update "Subsite Templates" under AreaTemplateSettings.aspx

Hi, This time I am discussing about how one can update the "AvailableWebTemplates" once you have created a site. Just for the information, we can define this property in Onet.xml while creating any new site. But what if you have created sites, sub sites underneath and sub sub sites underneath, in that case you need a power shell script to update all those values. Background: This property is defined in Onet as shown below: <Feature ID="22A9EF51-737B-4ff2-9346-694633FE4416"> ----------------- <Property Key="AvailableWebTemplates" Value="*-CMSPUBLISHING#0;*-BLANKINTERNET#2;*-ENTERWIKI#0;*-SRCHCEN#0"/> --------------------- </Feature> But once site is created using this site template, we have to dig down to update this. Using power shell its quite easy task provided you must know the Id and template name. Work Arround: We using the below mention code we can override the web template property. In order to update that we must know th