Tuesday, August 18, 2009

Enabling Content and Structure tool in non Publishing Sites

Often I get a request for having the content and structure tool available in the Site Actions on a normal collaboration site. This is often the case when the root of the portal has the publishing feature activated and then subsites were created using the team site template. The solutions is pretty simple and can be achieved easily using a feature.
All you need to do is create a feature which adds a link to /_layouts/sitemanager.aspx to the Site Actions menu.
Site Owners can get to this link already via Site Settings in the collaboration site, but site members have no access to the site settings page and thus it seemes that site members can not access the content and structure tool from the subsite.
Below is a sample feature and elements xml to create the missing link in the site actions.
Feature.xml:
<?xml version="1.0" encoding="utf-8"?><Feature Id="FEAD7313-AE6D-45DD-8260-13B563CB4C72" Title="Content and Structure Site Actions" Description="Enables the Content and Structure Site Actions Menu Item" Version="1.0.0.0" Scope="Web" Hidden="FALSE" DefaultResourceFile="core" xmlns="http://schemas.microsoft.com/sharepoint/"> <ElementManifests> <ElementManifest Location="menu.xml" /> </ElementManifests> <ActivationDependencies> <ActivationDependency FeatureId="A392DA98-270B-4e85-9769-04C0FDE267AA" /> </ActivationDependencies></Feature>
menu.xml:
<?xml version="1.0" encoding="utf-8"?><Elements xmlns="http://schemas.microsoft.com/sharepoint/"> <CustomAction Id="ContentStructureMenu" GroupId="SiteActions" Location="Microsoft.SharePoint.StandardMenu" Sequence="20" Title="Manage Content and Structure" Description="Reorganise content and structure in this site" ImageUrl="/_layouts/images/SMT_SMALL.png"> <UrlAction Url="javascript:window.location='{SiteUrl}/_layouts/sitemanager.aspx?Source=' + encodeURIComponent(window.location)" /> </CustomAction></Elements>

No comments: