Friday, April 15, 2011

Open Links in a new window in SharePoint 2010

Beleive it or not, but SharePoint 2010 OOB does not support opening links in a new browser window when using the URL field/column. The best work around is to:
  1.  open the page with the XSLTViewWebpart that displays the hyperlinks in SharePoint designer.
  2. Now Click on Design tab on SharePoint Designer and select "Customize XSLT > Customize Entire View".
  3. Then locate your <a> tag and you would note that the attribute value set to href='{$url}'. Beside this attribute include the following - onclick="window.open(this.href); return false;" onkeypress="window.open(this.href); return false;"
  4. Save and Preview the page in browser and eureka the links for the above web part will now open in new browser window

soap:ServerServer was unable to process request. ---> Value does not fall within the expected range.

If you renamed your SharePoint site or added a new Alternate access mapping (access via central admin), then use the new mapped name using SharePoint Designer 2010 (as opposed to the servename you might be using now). And you would notice that this error "soap:ServerServer was unable to process request. ---> Value does not fall within the expected range." goes away...

Friday, April 08, 2011

How to hide View All Site Content for everyone except for Admin users in SharePoint 2010

look for this tag on default.master or the custom master page you are using:

<SharePoint:ClusteredSPLinkButtonid="idNavLinkViewAllV4"runat="server"PermissionsString="ViewFormPages"NavigateUrl="~site/_layouts/viewlsts.aspx"ImageClass="s4-specialNavIcon"ImageUrl="/_layouts/images/fgimg.png"ImageWidth=16ImageHeight=16OffsetX=0OffsetY=0Text="<%$Resources:wss,quiklnch_allcontent_short%>"

Replace the PermissionsString property in above tags from "ViewFormPages" to "ManageWeb"
accesskey="<%$Resources:wss,quiklnch_allcontent_AK%>"/>

Hide the Recycle Bin link on the left hand bar for non-admin users in SharePoint 2010

look for this tag on default.master or the custom master page you are using:

<SharePoint:SPLinkButton runat="server" NavigateUrl="~site/_layouts/recyclebin.aspx" id="v3idNavLinkRecycleBin" ImageUrl="/_layouts/images/recycbin.gif" Text="<%$Resources:wss,StsDefault_RecycleBin%>" PermissionsString="DeleteListItems" />
and the tag

<SharePoint:ClusteredSPLinkButtonrunat="server"NavigateUrl="~site/_layouts/recyclebin.aspx"ImageClass="s4-specialNavIcon"ImageUrl="/_layouts/images/fgimg.png"ImageWidth=16ImageHeight=16OffsetX=0OffsetY=428id="idNavLinkRecycleBin"Text="<%$Resources:wss,StsDefault_RecycleBin%>"CssClass="s4-rcycl"PermissionsString="DeleteListItems" />
Replace the PermissionsString property in above tags from "DeleteListItems" to "ManageWeb"