Problems with a publishing site custom WebTemplate
-
vendredi 13 avril 2012 14:16
Hi,
I am creating a custom webtemplate and am basing it on the OOTB blankinternet template id 53.
See the bottom of my post for my code:
My WebTemplate deploys fine and when I create a site collection it appears to work however I get a 404 when I view the root site collection. If I add _layouts/settings.aspx I can see the settings page and so the site is definitely created.
My guess is that I am missing some custom welcome pages. Can someone please help me understand what I must do to avoid getting 404 errors? I want to have all the OOTB page layouts available to my publishing pages also.
ONET.XML
<?xml version="1.0" encoding="utf-8" ?> <!-- _lcid="1033" _version="12.0.2220" _dal="1" --> <!-- _LocalBinding --> <Project Revision="3" Title="$Resources:cmscore,PublishingSiteWebName;" ListDir="Lists" xmlns:ows="Microsoft SharePoint" UIVersion="4"> <NavBars> <NavBar Name="SharePoint Top Navbar" ID="1002"> </NavBar> </NavBars> <ListTemplates /> <DocumentTemplates /> <Configurations> <Configuration ID="-1" Name="NewWeb"/> <Configuration ID="0" Name="BLANKINTERNET"> <SiteFeatures> <!-- Workflow Features --> <!-- Workflow Expiration --> <Feature ID="C85E5759-F323-4EFB-B548-443D2216EFB5" /> <!-- DLC Workflows --> <Feature ID="0AF5989A-3AEA-4519-8AB0-85D91ABE39FF" /> <!-- "A44D2AA3-AFFC-4d58-8DB4-F4A3AF053188" --> <Feature ID="A44D2AA3-AFFC-4d58-8DB4-F4A3AF053188" /> <Feature ID="A392DA98-270B-4e85-9769-04C0FDE267AA"> <!-- PublishingPrerequisites --> </Feature> <Feature ID="7C637B23-06C4-472d-9A9A-7C175762C5C4"> <!-- ViewFormPagesLockDown --> </Feature> <Feature ID="AEBC918D-B20F-4a11-A1DB-9ED84D79C87E"> <!-- PublishingResources --> <Properties xmlns="http://schemas.microsoft.com/sharepoint/"> <Property Key="AllowRss" Value="false"/> <Property Key="SimplePublishing" Value="false" /> </Properties> </Feature> <Feature ID="F6924D36-2FA8-4f0b-B16D-06B7250180FA"> <!-- Office SharePoint Server Publishing --> </Feature> </SiteFeatures> <WebFeatures> <!-- Include the common WSSListTemplateFeatures used by CMS --> <Feature ID="00BFEA71-DE22-43B2-A848-C05709900100" > </Feature> <Feature ID="00BFEA71-E717-4E80-AA17-D0C71B360101" > </Feature> <Feature ID="00BFEA71-52D4-45B3-B544-B1C71B620109" > </Feature> <Feature ID="00BFEA71-A83E-497E-9BA0-7A5C597D0107" > </Feature> <Feature ID="00BFEA71-4EA5-48D4-A4AD-305CF7030140" > </Feature> <Feature ID="00BFEA71-F600-43F6-A895-40C0DE7B0117" > </Feature> <Feature ID="22A9EF51-737B-4ff2-9346-694633FE4416"> <!-- Publishing --> <Properties xmlns="http://schemas.microsoft.com/sharepoint/"> <Property Key="ChromeMasterUrl" Value="~SiteCollection/_catalogs/masterpage/nightandday.master"/> <Property Key="WelcomePageUrl" Value="$Resources:osrvcore,List_Pages_UrlName;/default.aspx"/> <Property Key="PagesListUrl" Value=""/> <Property Key="AvailableWebTemplates" Value="*-BLANKINTERNET#2;*-ENTERWIKI#0"/> <Property Key="AvailablePageLayouts" Value=""/> <Property Key="AlternateCssUrl" Value="" /> <Property Key="SimplePublishing" Value="false" /> </Properties> </Feature> <Feature ID="541F5F57-C847-4e16-B59A-B31E90E6F9EA"> <!-- Per-Web Portal Navigation Properties--> <Properties xmlns="http://schemas.microsoft.com/sharepoint/"> <Property Key="InheritGlobalNavigation" Value="true"/> <Property Key="IncludeSubSites" Value="true"/> <Property Key="IncludePages" Value="false"/> </Properties> </Feature> <Feature ID="94C94CA6-B32F-4da9-A9E3-1F3D343D7ECB"> <!-- Office SharePoint Server Publishing --> </Feature> </WebFeatures> <Modules /> </Configuration> </Configurations> <Modules /> </Project>
Elements.xml includes the following:
<?xml version="1.0" encoding="utf-8"?> <Elements xmlns="http://schemas.microsoft.com/sharepoint/"> <WebTemplate BaseConfigurationID="0" BaseTemplateID="53" BaseTemplateName="BLANKINTERNET" ... ... ...
Am I missing some of the important sections that would have been present in the <Module> tags?- Modifié Speedbird85 vendredi 13 avril 2012 14:24
Toutes les réponses
-
vendredi 13 avril 2012 16:02
I have copied some code into a module and added it as part of the feature. By specifying the feature GUID in my webtemplate onet.xml I have managed to get something working.
<?xml version="1.0" encoding="utf-8"?> <Elements xmlns="http://schemas.microsoft.com/sharepoint/"> <Module Name="Home" Url="$Resources:osrvcore,List_Pages_UrlName;" Path=""> <File Path="IntranetWelcomePage\default.aspx" Url="default.aspx" Type="GhostableInLibrary" > <Property Name="Title" Value="$Resources:cmscore,IPPT_HomeWelcomePage_Title;" /> <Property Name="PublishingPageLayout" Value="~SiteCollection/_catalogs/masterpage/WelcomeSplash.aspx, $Resources:cmscore,PageLayout_WelcomeSplash_Title;" /> <Property Name="ContentType" Value="$Resources:cmscore,contenttype_welcomepage_name;" /> <Property Name="PublishingPageImage" Value="<img border="1" hspace="0" src="~SiteCollection/SiteCollectionImages/home.jpg" vspace="0" style="margin-right:-6px" alt="">" /> <Property Name="SummaryLinks" Value="<div title="_schemaversion" id="_3"> <div title="_links"> <div title="_link"> <span title="_title">$Resources:cmscore,IPPT_HelpLinks_EnableAnonymous_Text;</span> <span title="_description">$Resources:cmscore,IPPT_HelpLinks_EnableAnonymous_Description;</span> <span title="_linkurl"> <a href="~SiteCollection/_layouts/setanon.aspx">~SiteCollection/_layouts/setanon.aspx</a> </span> <span title="_style">Default</span> <span title="_order">1</span> <span title="_begincolumn">True</span> </div> <div title="_link"> <span title="_title">$Resources:cmscore,IPPT_HelpLinks_ManageNavigation_Text;</span> <span title="_description">$Resources:cmscore,IPPT_HelpLinks_ManageNavigation_Description;</span> <span title="_linkurl"> <a href="~SiteCollection/_layouts/areanavigationsettings.aspx">~SiteCollection/_layouts/areanavigationsettings.aspx</a> </span> <span title="_style">Default</span> <span title="_order">2</span> <span title="_begincolumn">False</span> </div> <div title="_link"> <span title="_title">$Resources:cmscore,IPPT_HelpLinks_GoToMasterPageGallery_Text;</span> <span title="_description">$Resources:cmscore,IPPT_HelpLinks_GoToMasterPageGallery_Description;</span> <span title="_linkurl"> <a href="~SiteCollection/_catalogs/masterpage/Forms/AllItems.aspx">~SiteCollection/_catalogs/masterpage/Forms/AllItems.aspx</a> </span> <span title="_style">Default</span> <span title="_order">3</span> <span title="_begincolumn">False</span> </div> <div title="_link"> <span title="_title">$Resources:cmscore,IPPT_HelpLinks_ManageContent_Text;</span> <span title="_description">$Resources:cmscore,IPPT_HelpLinks_ManageContent_Description;</span> <span title="_linkurl"> <a href="~SiteCollection/_layouts/sitemanager.aspx">~SiteCollection/_layouts/sitemanager.aspx</a> </span> <span title="_style">Default</span> <span title="_order">4</span> <span title="_begincolumn">False</span> </div> <div title="_link"> <span title="_title">$Resources:cmscore,IPPT_HelpLinks_SetupMLS_Text;</span> <span title="_description">$Resources:cmscore,IPPT_HelpLinks_SetupMLS_Description;</span> <span title="_linkurl"> <a href="~SiteCollection/_layouts/VariationSettings.aspx">~SiteCollection/_layouts/VariationSettings.aspx</a> </span> <span title="_style">Default</span> <span title="_order">5</span> <span title="_begincolumn">False</span> </div> <div title="_link"> <span title="_title">$Resources:cmscore,IPPT_HelpLinks_AddUsers_Text;</span> <span title="_description">$Resources:cmscore,IPPT_HelpLinks_AddUsers_Description;</span> <span title="_linkurl"> <a href="~SiteCollection/_layouts/groups.aspx">~SiteCollection//_layouts/groups.aspx</a> </span> <span title="_style">Default</span> <span title="_order">1</span> <span title="_begincolumn">True</span> </div> </div> <div title="_view"> <span title="_columns">1</span> <span title="_linkstyle"></span> <span title="_groupstyle"></span> </div></div>" /> </File> </Module> </Elements>This line was the problem:
<File Path="IntranetWelcomePage\default.aspx" Url="default.aspx" Type="GhostableInLibrary" >
I had to add the Path property otherwise it couldn't find the file.
Now all I need to know is how to stop the webtemplate from creating a search page for me.
Thanks
-
vendredi 13 avril 2012 20:15
I believe I am slowly making progress. I have changed my webtemplate to be based off the team site instead so that has done away with the 'Press Releases' and 'Search' sites being created by default.
Now all I need to do is work out how to hide certain elements programmatically from my top navigation.

