The onet.xml file is divided into two parts, first is the "SiteFeatures" and the second called "WebFeatures". The "SiteFeatures" Section that holds the site features starts activating all the features only when creating a site collection.
The "WebFeatures" Section that holds the web features starts activating all the web scoped features only when creating a ...
yes, You can have a site definition with more then 1 configuration, and you can use one of them to create a site,
for example, when we try to create a site we give web template name its configuration ID,
Let say you got a site definition with two configuration, 1 and 0,
STS#0 Team Site
STS#1 Blank Site
You can create a Team site by using ...
Use the NavBars Element in the onet.xml file ...
<NavBar Name="SharePoint Top Navbar" ID="1002"></NavBar>
That will display your global navigation within the Site Definition ...
In a non publishing site, you should be able to use web.Navigation.UseShared = true; ... where web is SPWeb type.
In a publishing ...
<asp:Content ContentPlaceHolderId="PlaceHolderPageTitleInTitleArea" runat="server">
<label class="ms-hidden"><SharePoint:ProjectProperty Property="Title" runat="server"/></label>
This is a snippet from default.aspx in C:\Program Files\Common Files\microsoft shared\Web Server Extensions\15\TEMPLATE\...
As you mentioned, site definitions should not be changed once it is provisioned. It is just not supported. A great blog on this topic is here.
An extract from the same link
Biggest challenge with the site definition is that we are not allowed to change the onet.xml file after it has been used to provision any sites in the environment. This is just not ...
If you want to set the site logo on feature activated you need to add an event receiver to the feature.
Here is a sample code to update logo on feature activated.
public override void FeatureActivated(SPFeatureReceiverProperties properties)
SPWeb web = (SPWeb) properties.Feature.Parent;
web.SiteLogoUrl = "" ; //set your path
First create the list you are trying to reference in the feature receiver that you added to your onet.xml file. Then create the list view web part as you have done in your onet.xml.
This will result in your list being there when you are trying to reference it by creating the list view web part.
Changing the Site Definition is unsupported. Existing sites should be changed using the object model while the changes to the Site Definition will be applied to all newly created sites.
A good guideline is to use site definitions to modify sites that will be created, but to use the object model to modify sites after they are created.
So first thing to ...
When provisioning Discussion Board it is required to specify ContentTypeID attribute for View element as demonstrated below:
where ContentTypeID value is set to 0x012001 (RootOfList)
Most likely the problem lies in the site definition's ONET.XML in the NavBars section. The NavBar with ID 1002 is missing. You might also encounter errors when editing navigation as described here: Unable to modify navigation heading link.
I also recommend that you read this: Charlie Holland's NavBars - if only it was that simple!
Generally you could provision List instances and data using something similar to below:
<ListInstance Title="My Survey"
The navigation inheritance is a functionality of Publishing feature. This feature changes data provider for navigation by delegate control. Are you sure that your site definition activates this feature?
I'm sure you found a workaround for this by now. I'm posting this for anyone still looking for the answer. All you need to do is use the correct namespace: "urn:schemas-microsoft-com:sharepoint:TagCloudWebPart"
SharePoint automatically set those links in the quicklaunch. I suggest to create a feature with a receiver and add this feature to your ONET. Programmatically add those links to the quicklaunch.
SPNavigationNodeCollection nodes = web.Navigation.QuickLaunch;
SPNavigationNode navNode = new SPNavigationNode("MyLink", "http://mylink.com",false);
It would be nice to know which kind of problems you experience.
But at Least I can see following possible issues:
It seems as if you don't define Site Columns and ContentType before List Definition
You're missing listing all the FieldRefs in Schema.xml