When you add a survey list to a site using a webtemplate or sitetemplate you add the following line to the onet.xml:
<Lists>
<List FeatureId="00bfea71-eb8a-40b1-80c7-506be7590102" Type="102" Title="$Resources:core,surveyList;" Url="$Resources:core,lists_Folder;/$Resources:core,surveyList;" QuickLaunchUrl="$Resources:core,lists_Folder;/$Resources:core,surveyList;/overview.aspx" />
</Lists>
When you create a site with this onet.xml the survey list is created however it’s not added to the quicklaunch. This is probably because the <Navbars> doesn’t contain a ‘Survey’ category.
To fix this add this line to the <Navbars> element:
<NavBar Name="$Resources:core,category_Surveys;" Prefix="<table border='0' cellpadding='4' cellspacing='0'>" Body="<tr><td><table border='0' cellpadding='0' cellspacing='0'><tr><td><img src='/_layouts/images/blank.gif' id='100' alt='' border='0'>&nbsp;</td><td valign='top'><a id='onetleftnavbar#LABEL_ID#' href='#URL#'>#LABEL#</td></tr></table></td></tr>" Suffix="</table>" ID="1007" />
Or you could use one of the alternatives:
- Add the survey list in code (web.Lists.Add with SPListTemplateType.Survey) and set OnQuickLaunch to true.
- manually add the survey list to the quicklaunch using the List Settings –> Title, description and navigation. The Navbar item will be added automatically.
Great post THanks!!1
ReplyDelete