Saturday, September 25, 2010

How to find the SharePoint Site Template being Used

How to find the site template of an existing SharePoint site? There are many ways to find the site definition being used for a site, Here are some:

1. Use SharePoint Manager to find SharePoint site template. Navigate thru the site, and look for "Web Template" as in the below picture.

2. Stsadm: Get current site template in SharePoint
stsadm.exe -o enumallwebs -databasename <content-db-name> > Template.txt
Now, Open the template.txt file and check for template. This trick can be used to find site template name for SharePoint 2010 even.
sharepoint find site template id

3. Sql Server: SQL Server is the back-bone of SharePoint, So lets use the SQL Query to determine SharePoint site template used:
SELECT Title, WebTemplate FROM dbo.Webs WHERE Title='Your Site'

4. You can programmatically use SharePoint Object Model to find site template of SharePoint site. Just query  SPWeb.WebTemplateId. Here is the reference table for SharePoint 2007:
Template IDCodeDescription
1 STS  "windows SharePoint Services Site", "Team Site", "Blank Site", "Document Workspace"
2 MPS  "Basic Meeting Workspace", "Blank Meeting Workspace", "Decision Meeting Workspace", "Social Meeting Workspace", "Multipage Meeting Workspace"
3 CENTRALADMIN  "Central Admin Site"
4 WIKI  "Wiki Site"
7 BDR  "Document Center"
9 BLOG  "Blog"
20 SPS (OBSOLETE)  "SharePoint Portal Server Site"
21 SPSPERS  "SharePoint Portal Server Personal Space"
22 SPSMSITE  "Personalization Site"
30 SPSTOC (OBSOLETE)  "Contents area Template"
31 SPSTOPIC (OBSOLETE)  "Topic area template"
32 SPSNEWS (OBSOLETE)  "News area template"
33 SPSNHOME (SubWebOnly)  "News Home template"
34 SPSSITES  "Site Directory area template"
36 SPSCOMMU (OBSOLETE)  "Community area template"
38 SPSREPORTCENTER  "Report Center Site"
39 CMSPUBLISHING (SetupPath=SiteTemplates\PUBLISHING)  "Publishing and Team Collaboration Site"
40 OSRV (SetupPath=SiteTemplates\OSRV)  "Shared Services Administration Site"
47 SPSPORTAL  "Corporate Intranet Site"
50 SRCHCEN  "Search Center"
51 PROFILES  "Profiles"
52 BLANKINTERNETCONTAINER  "Internet Presence Web Site"
53 BLANKINTERNET  "Publishing Site", "Press Releases Site", "Publishing Site"
54 SPSMSITEHOST  "My Site Host"
90 SRCHCENTERLITE (SetupPath=SiteTemplates\SRCHCENTERLITE)  "Search Center Lite"
6221 PWA (SetupPath=SiteTemplates\PWA)  "Project Web Access Site"
6215 PWS (SetupPath=SiteTemplates\PWS)  "Project Workspace"
14483 OFFILE  "Records Repository", "Records Repository"

5. SharePoint 2010 - Find template used create site: Get SharePoint site template id using PowerShell:
In SharePoint 2010, You can get the list of site templates by using a PowerShell Cmd-let:
Get-SPWebTemplate

Here is the reference table for SharePoint 2010:
Site Template IDSite Definition
STS#0Team Site
STS#1Blank Site
STS#2Document Workspace
BLOG#0Blog
SGS#0Group Work Site
VISPRUS#0Visio Process Repository
MPS#0Basic Meeting Workspace
MPS#1Blank Meeting Workspace
MPS#2Decision Meeting Workspace
MPS#3Social Meeting Workspace
MPS#4Multipage Meeting Workspace
ACCSRV#1Assets Web Database
ACCSRV#3Charitable Contributions Web Database
ACCSRV#41Contacts Web Database
ACCSRV#6Issues Web Database
ACCSRV#5Projects Web Database
BDR#0Document Center
OFFILE#1Records Center
BICenterSite#0Business Intelligence Center
SPSMSITEHOST#0My Site Host
SPSMSITE#0Personalization Site
SRCHCEN#0Enterprise Search Center
SRCHCENTERLITE#0Basic Search Center
SRCHCENTERFAST#0FAST Search Center
ENTERWIKI#0Enterprise Wiki
BLANKINTERNETCONTAINER#0Publishing Portal
CMSPUBLISHING#0Publishing Site

6. Last but not least: Go to the view source of the SharePoint page >> Search for "SiteTemplateID" to find site template name SharePoint 2010.
find template used sharepoint site


You might also like:
SharePoint Usage Reports
Usage reports, collaboration and audit for SharePoint.
Document SharePoint Farm
Automatically generate SharePoint documentation.
*Sponsored


Saturday, September 18, 2010

Convert Subsite to Site Collection and Site Collection to Subsite in SharePoint

During the migration of MOSS 2007 to SharePoint 2010, wanted to convert some of the large subsites into site collection in a separate content databases. How to convert a subsite to a site collection in SharePoint? sure, Its possible to promote subsite to site collection in SharePoint.

Follow these Steps to Convert Subsite to Site collection:
  1. Export the Source sub-site
  2. Create a new Site collection in Separate content database
  3. Import the backup into the site collection.


1. Export the subsite
Export the source sub-site using STSADM command line:
stsadm -o export -url <URL-of-the-Sub-site> -filename <Backup-File-Name> -includeusersecurity -versions 4

2. Create a New Site collection in its own Database, without assigning template
Execute this command line to create a new site collection in new content database.
stsadm -o createsiteinnewdb -url <Site collection URL> -owneremail <e-mail of the site owner> -ownerlogin <domain\username>  -title <Title-for-site-collection>  -databaseserver  <DB-Server-Name> -databasename <Database-name>

3. Import the SubSite Export(Backup) into the Site collection
Now, we need to import the sub-site into the newly created site collection. Use the STSADM command line:
stsadm -o import -url <Target-Site-collection-URL> -filename <backup-File-Name> -includeusersecurity
convert a subsite to a site collection in sharepoint 2010

To convert site collection to subsite:
Want the reverse? move a site collection to a subsite in SharePoint 2007? Simple: Export the site collection using stsadm -o export, creates a blank sub-site, and then import the exported site collection into sub-site using stsadm-o import.
 Just Export the Site collections and import them as Sub-site:
stsadm -o export -url http://sharepoint.com/sites/site-collection -filename c:\sitecollection.bak -includeusersecurity -nofilecompression
stsadm -o import url http://sharepoint.com/sites/site-collection/subsite -filename c:\sitecollection.bak -includeusersecurity -nofilecompression

Or you can use Third party products like: DocAve or ControlPoint to migrate SharePoint subsite to site collection. 

Testing:
Browse to the Site collection, verify Page Layouts, master pages, content types, navigation, web parts and etc. Once tested, delete the sub-site using: stsadm -o deleteweb -url <sub-site-url>

Please note, In Export-Import you'll loose few things, such as:
  • Workflow Associations, History, Tasks
  • Alerts
  • Feature/Solutions activated
  • Recycle bin
Troubleshooting:
If you get  “File not found" or "Page not found" don’t panic. Look into welcome page/Master page settings. If you are moving from one environment from another, make sure you have identical features/solutions deployed in both the environments.

In case of Publishing sites, It may lead to page layout issues (site collection pages will be pointing to old-sub-site’s page layouts).Use Gary’s STSADM extensions to resolve:
http://blog.falchionconsulting.com/index.php/downloads/

stsadm –o gl-repairsitecollectionimportedfromsubsite –sourceurl <sub-site-URL> -targeturl <Site-collection-URL>

 http://blog.falchionconsulting.com/index.php/2007/09/convert-a-sub-site-to-a-site-collection/

You might also like:
SharePoint Usage Reports
Usage reports, collaboration and audit for SharePoint.
Document SharePoint Farm
Automatically generate SharePoint documentation.
*Sponsored


Wednesday, September 15, 2010

Hide Site templates & List Templates in SharePoint

In my SharePoint Farm, I wanted to disable certain site templates in site creation page.
hide site template sharepoint

Here is the technique for hiding a Site template in SharePoint 2007:
There are XML manifest files found on the file system of the web front end.
  •     Look for the file webtemp.xml,webtempsps.xml,etc  in "C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\1033\XML\"
how to hide a site template in sharepoint
  •     Make a backup of this files you are modifying
  •     Open the file in notepad and look for the site template you want to hide
  •     Change Hidden="FALSE" into Hidden="TRUE" (case sensitive) and save the file
hide site template sharepoint 2010
  •     Do an IISRESET
This will hide the specific site template from the list of templates available when you create a site.

Hide SharePoint List or Library Templates

Same way, you can hide the list template in SharePoint 2007 too, here is how:
  • First find the template/feature you want to modify in "web server extensions\12\TEMPLATE\FEATURES"
  • If you want to be able to show or hide the list through the Site Features, do the following:
  • Make a backup copy of feature.xml
  • Open the xml file in notepad and change Hidden="TRUE" into Hidden="FALSE" (case sensitive) and save the file
  • Do an IISRESET
If you want to hide the list all together, do the following:
  •  Open the sub-folder named "ListTemplates"
  •  Make a backup copy of the .xml file (good practice)
  • Open the xml file in notepad and add this line somewhere around the Type or BaseType line: Hidden="TRUE" (case sensitive)
  • Do an IISRESET


You might also like:
SharePoint Usage Reports
Usage reports, collaboration and audit for SharePoint.
Document SharePoint Farm
Automatically generate SharePoint documentation.
*Sponsored


Thursday, September 9, 2010

Content deployment in MOSS 2007

Content deployment in MOSS 2007: Check out my Presentation


You might also like:
SharePoint Usage Reports
Usage reports, collaboration and audit for SharePoint.
Document SharePoint Farm
Automatically generate SharePoint documentation.
*Sponsored


Saturday, September 4, 2010

How to display Google map in SharePoint?

In SharePoint, we can display Google Maps without any third party web parts. Here I'm explain how you can insert "Google Maps" maps in your SharePoint site with standard out of the box SharePoint features. You can display Google maps in SharePoint by embedding Google map code in SharePoint Content Editor Web Part.

Go to Google Maps (http://maps.google.com) , Enter & Grab the code for target location.(As indicated in the below picture)
display google map sharepoint


























Now Open the SharePoint site and follow the below steps:
1. Create a web part page, and then add content editor web part into it.
2. Edit the CEWP, paste the code from Google maps to CEWP by clicking source code(NOT Rich text editor!!!)
3. Save and exit the page.
and here is what you will get:

google map for sharepoint

Use the same trick to embed Google map in SharePoint 2010 . Here is the feature based one: http://spgooglemap.codeplex.com/

You might also like:
SharePoint Usage Reports
Usage reports, collaboration and audit for SharePoint.
Document SharePoint Farm
Automatically generate SharePoint documentation.
*Sponsored


Thursday, September 2, 2010

How to Add a Link to SharePoint Site Actions Menu

You can create a Custom link in Site Action Menu using CustomAction feature code. My Requirement is to add a new link "Support Center" in Site actions Menu, So that all site owners can easily access the SharePoint Support Center site.
  1. Create a folder in 12/14 hive's Features folder, say "Crescent.SharePoint.SupportLink" under C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\FEATURES
  2. Create these two files  update them as per the below content
  3. Install and activate the feature. sharepoint add link to site actions menu
    See the SharePoint 2010 custom site action Menu Link in action!
Add Custom Link to SharePoint Site Actions Menu

Feature.xml:

<?xml version="1.0" encoding="utf-8" ?>
 <Feature Id="05BA4E54-C1E9-4244-8276-06451EBBB260" Title="SharePoint Support Center Link" Description="Shows Support Center Link in Site Actions Menu" Scope="Site"
         xmlns="http://schemas.microsoft.com/sharepoint/">
 
  <ElementManifests>
  <ElementManifest Location="Elements.xml" />
   </ElementManifests>
  
 </Feature>

Elements.xml:

<?xml version="1.0" encoding="utf-8" ?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
 
 <CustomAction Id="SupporCenterLink" GroupId="SiteActions"
          Location="Microsoft.SharePoint.StandardMenu" Sequence="2000"
               Title="Support Center" Description="Go to Support Center for SharePoint Tutors, Requests, FAQs, etc." 
                    ImageUrl="_layouts/Crescent/Images/supportLink.png" >
 <UrlAction Url="http://support.company.com/sharepoint" />
 
 </CustomAction>
</Elements>

As a Best practice, pack these xml & Image as a Solution in Visual Studio, So that It can be deployed anywhere. can read more about the custom action on MSDN: http://msdn.microsoft.com/en-us/library/bb418728.aspx

You might also like:
SharePoint Usage Reports
Usage reports, collaboration and audit for SharePoint.
Document SharePoint Farm
Automatically generate SharePoint documentation.
*Sponsored


Add a Custom Group of Actions in SharePoint 2007 Site Settings Page

Requirement: Adding a custom group of actions in SharePoint site settings page.

Solution: We can create a feature to achieve this. Here is what I've done:
  • Create a folder"MyCustomAction" under: C:\Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\FEATURES
  • Create these two files in MyCustomAction folder:

  • Feature.xml
  • Elements.xml
  • Place the below content in the above files:

    Feature.xml

    <?xml version="1.0" encoding="utf-8" ?>
    <Feature xmlns="http://schemas.microsoft.com/sharepoint/" 
    Id="5DFD12AF-D0AA-4c63-8FB8-C49DB1191083" Title="Custom Site Actions Feature" Description="Adds Custom Actions to the Site actions Menu" Scope="Site" Version="1.0.0.0">
        <ElementManifests>
            <ElementManifest Location="Elements.xml"/>
        </ElementManifests>
    </Feature>

    Elements.xml

    <?xml version="1.0" encoding="utf-8"?>
    <Elements xmlns="http://schemas.microsoft.com/sharepoint/">
    <!-- Custom Action Group -->

    <CustomActionGroup Id="MyActionGroup
    Description="This group contains all my custom actions.
    Title="My Custom Action Group" 
    Location="Microsoft.SharePoint.SiteSettings" Sequence="0" />
     
    <!-- Custom Action in Custom Action Group -->
    <CustomAction Id="MyCustomAction1"
    Description="This link is a custom action."
    Title="My Custom Action 1" 
    GroupId="MyActionGroup"
    Location="Microsoft.SharePoint.SiteSettings"
    Rights="ManageWeb" 
    RequireSiteAdministrator="FALSE"
    Sequence="1">
    <UrlAction
    Url="~sitecollection/_layouts/MyCustomPage1.aspx" />

    </CustomAction>

    <CustomAction
        Id="MyCustomAction2"
        Description="This link is a custom action."
        Title="My Custom Action 2
        GroupId="MyActionGroup"
        Location="Microsoft.SharePoint.SiteSettings"
        Rights="ManageWeb" 
        RequireSiteAdministrator="FALSE"
        Sequence="2">
       <UrlAction Url="~sitecollection/_layouts/MyCustomPage2.aspx" />
     </CustomAction>
    </Elements>

    Install and activate the feature by these commands:

    • stsadm -o installfeature -filename MyCustomAction\feature.xml
    • stsadm -o activatefeature -filename MyCustomAction\feature.xml -url http://Server/Site/Subsite
    • Iisreset
    Finally, you will get the feature activated and shown under site settings page as below image

    Add Custom Group to SharePoint Site Settings Page
    For SharePoint 2010, Here is the article: Add a Link to Site Settings Page in SharePoint 2010

        


    You might also like:
    SharePoint Usage Reports
    Usage reports, collaboration and audit for SharePoint.
    Document SharePoint Farm
    Automatically generate SharePoint documentation.
    *Sponsored


    You might also like:

    Related Posts Plugin for WordPress, Blogger...