Hot answers tagged

3

You cannot provision Web Parts in Modules element using a Web Template. Consider adding a feature receiver or a Module SPI.


2

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 ...


2

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 ...


2

Use the NavBars Element in the onet.xml file ... <NavBars> <NavBar Name="SharePoint Top Navbar" ID="1002"></NavBar> </NavBars> 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 ...


2

<asp:Content ContentPlaceHolderId="PlaceHolderPageTitleInTitleArea" runat="server"> <label class="ms-hidden"><SharePoint:ProjectProperty Property="Title" runat="server"/></label> </asp:Content> This is a snippet from default.aspx in C:\Program Files\Common Files\microsoft shared\Web Server Extensions\15\TEMPLATE\...


2

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 ...


1

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 }


1

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.


1

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 ...


1

When provisioning Discussion Board it is required to specify ContentTypeID attribute for View element as demonstrated below: <View List="Lists/Discussion" BaseViewID="3" WebPartZoneID="WebPartZone2" DisplayName="Discussion" ContentTypeID="0x012001" /> where ContentTypeID value is set to 0x012001 (RootOfList)


1

Please try to delete this line: <?xml version="1.0" encoding="utf-8"?> after <![CDATA[


1

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!


1

Generally you could provision List instances and data using something similar to below: <Elements xmlns="http://schemas.microsoft.com/sharepoint/"> <ListInstance Title="My Survey" OnQuickLaunch="TRUE" TemplateType="102" FeatureId="00bfea71-2062-426c-90bf-714c59600103" Url="Lists/...


1

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?


1

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" <UserScope xmlns="urn:schemas-microsoft-com:sharepoint:TagCloudWebPart">UnderUrlEveryone</UserScope>


1

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. Example: SPNavigationNodeCollection nodes = web.Navigation.QuickLaunch; SPNavigationNode navNode = new SPNavigationNode("MyLink", "http://mylink.com",false); ...


1

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


Only top voted, non community-wiki answers of a minimum length are eligible