Site Definition visibility property

I was helping a co-worker of mine today determine why the Site Directory site definition was not showing up as an option underneath a Publishing Portal and found a nice property for site definitions I never knew existed. By the way, it turns out that in order for the Site Directory to show up as an option you need to have the PortalLayouts feature enabled, which of course is a hidden feature but is also enabled as a dependency from the Office SharePoint Server Standard Site Collection feature or the Office SharePoint Server Enterprise Site Collection feature. 

Anyway, after finding the Site Directory site definition I noticed this fun new property called VisibilityFeatureDependency in the webtempsps.xml file that sets a bunch of properties for the site definition.  Here is the entry for the Site Directory definition in that file:

 <Template Name="SPSSITES" ID="34">
    <Configuration ID="0" Title="Site Directory" Type="0" Hidden="FALSE" ImageUrl="/_layouts/1033/images/template_site_dir.png" Description="A site for listing and categorizing important sites in your organization. It includes different views for categorized sites, top sites, and a site map." DisplayCategory="Enterprise" VisibilityFeatureDependency="5F3B0127-2F1D-4cfd-8DD2-85AD1FB00BFC">
    </Configuration>

With that being said, if you have a custom site definition in your environment and have seen issues where people are creating sites based off of that definition, and you only want that custom definition available in specific areas you could take a similar approach by creating hidden features that you activate either through feature stapling, site definition properties or PowerShell activation and then those types of sites will only be available for end users at the level that those hidden features are activated on. 

A good example of this would be the normal Client and Project site relationship.  You have a client sites dashboard page for which all users can see the client sites that they have access to, and you activate a hidden feature at that level for which makes the Client Site definition available in the Create Site screen.  When the client site is created, the hidden Project Site activation feature is activated and you can then choose to create Project Sites from the Client site level.  Using this method you can guarantee that the client and project sites will only be created at the level where they are supposed to live.

Update:

I just read this morning that according to MSDN the VisibilityFeatureDependency property "is not supported for Features with Web application scope".  I'm going to try this out in the next coming weeks to see if it works for web scopes or if there are some underlying issues with it.  This information could just help define what features you may need to create and at what scope level.

["Brian"]

Published Thursday, July 17, 2008 2:46 PM by Brian Caauwe

Leave a Comment

(required) 
(required) 
(optional)
(required)