Friday, June 29, 2012

SharePoint 2010 - Missing Dropdown menu for choosing the views

When two or more web parts are added to the standard view page then the drop down menu for choosing view gets disappeared.

Resolution that worked for me is to edit the view Page in the SharePoint Designer advanced Mode

Look for the line,

<SharePoint:ListTitleViewSelectorMenu AlignToParent="true" id="LTViewSelectorMenu" runat="server" />

and replace with,

<SPAN id=onetidPageTitleSeparator><SPAN><SPAN style="POSITION: relative; WIDTH: 11px; DISPLAY: inline-block; HEIGHT: 11px; OVERFLOW: hidden"><IMG style="POSITION: absolute; BORDER-RIGHT-WIDTH: 0px; BORDER-TOP-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px; TOP: -585px !important; LEFT: 0px !important" alt=: src="/_layouts/images/fgimg.png"></SPAN></SPAN></SPAN>
<SharePoint:ViewSelectorMenu ID="viewSelectorMenu1" runat="server" />

Hope it helps someone !!

Creating a new permission level in SharePoint 2010 using PowerShell

When the out-of-the-box permission levels do not meet your needs then SharePoint 2010 allows you the capability to create new combinations of permissions that can cater your needs.

There are two ways of creating Permission level
 - SP2010 GUI
 - PowerShell.

Using SP2010 GUI it is very easy to create permission level, if this is only needed for one or two Site Collections. Imagine you have 100 + Site Collections then this solution will not work, Obvious choice is to use PowerShell.

Here is the PowerShell script to create custom permission level

When
$webapp = Get-SPWebApplication http://xyz.com
foreach ($SPSite in $webapp.sites)
{
$OpenWeb = $SpSite.OpenWeb()
$spWeb = Get-SPWeb $OpenWeb.url
$spRoleDefinition = New-Object Microsoft.SharePoint.SPRoleDefinition
$spRoleDefinition.Name = "Site Owner"
$spRoleDefinition.Description = "Custom Permission for Site Owner"
$spRoleDefinition.BasePermissions = "
ManageLists,
CancelCheckout,
AddListItems,
EditListItems,
DeleteListItems,
ApproveItems,
ViewListItems,
OpenItems,
ViewVersions,
DeleteVersions,
CreateAlerts,
ViewFormPages,
ManageSubwebs, 
CreateGroups, 
ManagePermissions,
ManageWeb,
ViewUsageData,
AddAndCustomizePages,
BrowseDirectories,
EnumeratePermissions,
ManageAlerts,
Open,
ViewPages,
BrowseUserInfo,
UseClientIntegration,
EditMyUserInfo,
UseRemoteAPIs,
AddDelPrivateWebParts,
UpdatePersonalWebParts,
ManagePersonalViews"
$spweb.RoleDefinitions.Add($spRoleDefinition)
$SPSite.Dispose()
$OpenWeb.Dispose()
}

Happy scripting J