Have you ever wondered that why only the “Publishing Site with workflow” definition is available to create a sub site under the publishing portal site collection. In nutshell we know that the site definition which has the “VisibiltyfeatureDependency” for the publishing infrastructure feature ( Feature Id - F6924D36-2FA8-4f0b-B16D-06B7250180FA) will be available only if the publishing infrastructure is activated. Fair enough, but why the other site definitions like STS #0, STS #1 … etc are not available which don’t have any feature dependency for the visibility. See the screenshot below, only the “Publishing Site with workflow” definition is available to create the sub site when the top level site collection is created from the “Publishing Portal” :
1. Not all the site definitions will be available to create sub site. The definitions which has the “SubWebOnly” attribute enabled will be available. But why the site definitions which don’t have any restriction for visibility are not available while creating the sub site.
2. What if you created a custom publishing site definition to create ONLY the sub site under the publishing portal collection ? You can see in the above screen shot that except the “Publishing Site with workflow” site definition none of the other site definitions are available to create the sub site.
Following is the webtemp entry for the custom publishing site definition I created . You can see that I have the “VisibilityFeatureDependency” set to the publishing infrastructure feature and the “SubWebOnly” is set to “TRUE”. But still the custom publishing site definition is unavailable to create the sub site under the publishing portal site collection in which the publishing infrastructure feature is already stapled.
<Templates xmlns:ows="Microsoft SharePoint">
<Template Name="FHLBPublishing" ID="10002">
Title="FHLB Publishing Site"
VisibilityFeatureDependency="F6924D36-2FA8-4f0b-B16D-06B7250180FA" SubWebOnly="TRUE" RootWebOnly="false" />
Title="FHLB Publishing Portal"
ProvisionAssembly="FHLBMinPubSiteDef, Version=18.104.22.168, Culture=neutral, PublicKeyToken=44b8eff5c4cf5544"
Title="FHLB Publishing Site with FHLB Serial Workflow"
Description="A FHLB site for publishing Web pages on a schedule by using approval workflows. It includes document and image libraries for storing Web publishing assets. By default, only sites with this template can be created under this site."
Another interesting thing is if I create “Team Site” and activate the “Publishing infrastructure feature” then it behaves differently. You can see in the following screenshot that my custom publishing site definition is available to create the sub site and note that all other site definitions (STS #0, STS #1 .. etc) also available as they don’t have any dependency for visibility.
While digging into deep found the following behavior of SharePoint. When the “Publishing Infrastructure” enabled it gives another feature of selecting the template to be available to create the sub site. You can find this feature called “Page layouts and site templates” in the “Site Settings” page under the “Look and Feel” group.
It actually gives you the option of selecting the templates to avail while creating a sub site. In the team site when the publishing infrastructure is activated then this option is set to “Sub sites can use any site template” (See below screenshot) so all the templates are available to create the sub site when they don’t have any visibility feature dependency.
But when it comes to the portal created from the publishing portal definition where the publishing infrastructure is already stapled then the story is different. Here only the “Publishing Site with workflow” definition is selected to create the sub site by default. So you need to select the definition in this page which you want to be avail to create the sub site.
Once you added the definition here then the selected templates will be available to create the sub site in the site creation page.
If you are creating custom site definitions to create the sub site then make sure that this setting is done so that they can get their site definition to create sub sites under collaboration portal / publishing portal collection using their custom site definition.