Tuesday, February 15, 2011

Add Publishing Navigation in a Team Site

I had the need for a team site, but instead of the standard quick launch, I wanted more of a publishing like navigation setup.  So I did the following:

1)  Create a new Site Template.  For reference I used:

http://www.toddbaginski.com/blog/archive/2009/11/02/how-to-create-a-custom-site-definition-in-sharepoint-2010.aspx.aspx

I copied the STS site template onet.xml file, and then created a new template in my webtemp_custom.xml file.

2)  Next add the Navigation Feature under WebFeatures in your onet.xml file:

        <!-- NavigationProperties Feature-->
        <Feature ID="541F5F57-C847-4e16-B59A-B31E90E6F9EA">
          <Properties xmlns="http://schemas.microsoft.com/sharepoint/">
            <Property Key="InheritGlobalNavigation" Value="true"/>
            <Property Key="ShowSiblings" Value="true"/>
            <Property Key="IncludeSubSites" Value="true"/>
          </Properties>
        </Feature> 

When you create a new site, you'll see that you have Navigation link in your Site Settings that you can now configure, just like a Publishing Site!

Failed to instantiate file "default.master" from module "DefaultMasterPage"

I ran into this error while trying to create a new Site Definition in SharePoint 2010.  It turns out that the TemplateName you select in your webtemp_custom.xml file:

<Template Name="CustonSiteDefinitions" ID="10000">

Must match the folder in your SiteTemplates directory:

14/TEMPLATE/SiteTemplates/CustomSiteDefinitions

otherwise you'll get the error above.

Thursday, February 10, 2011

Stsadm upgradesolution vs. deploysolution

upgradesolution != deploysolution

There are certain times when you can use upgradesolution, primarily only when you haven't added or removed any files from the project. 

The list of the constraints for when you cannot use stsadm –o upgradesolution:
  • The following operations are not supported in solution upgrade.
  • Removing old Features in a new version of a solution.
  • Adding new Features in a solution upgrade.
  • Updating or changing the receiver assembly for existing Features in a new version of a solution.
  • Adding or changing Feature elements (Element.xml files) in a new version of a solution.
  • Adding or changing Feature properties in a new version of a solution.
  • Changing the ID or scope of old Features in a new version of a solution.
  • Removing Feature elements (Element.xml files) in a new version of a solution.
  • Removing Feature properties in a new version of a solution. 
So if any of the above cases apply to you, you should do a retract/delete/add/deploy solution.