Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

Im trying to create a publishing site definition where I use one file to provision many templates.

eg in onet.xml
 ...
 <Modules>
    <Module Name="Landing" />
    <Module Name="Test" />
    <Module Name="Test2" />
 </Modules>
 ...
  <Modules>
<Module Name="Landing" Url="$Resources:osrvcore,List_Pages_UrlName;" Path="">
  <File Url="default.aspx" Type="GhostableInLibrary" Level="Draft">
      <Property Name="Title" Value="LPALanding" />
      <Property Name="PublishingPageLayout" Value="~SiteCollection/_catalogs/masterpage/WelcomeLinks.aspx, $Resources:cmscore,PageLayout_WelcomeLinks_Title;" />
      <Property Name="ContentType" Value="$Resources:cmscore,contenttype_welcomepage_name;" />
  </File>
</Module>
<Module Name="Test" Url="$Resources:osrvcore,List_Pages_UrlName;" Path="">
      <File Url="default2.aspx" Type="GhostableInLibrary" Level="Draft">
          <Property Name="Title" Value="Test" />
          <Property Name="PublishingPageLayout" Value="~SiteCollection/_catalogs/masterpage/WelcomeLinks.aspx, $Resources:cmscore,PageLayout_WelcomeLinks_Title;" />
          <Property Name="ContentType" Value="$Resources:cmscore,contenttype_welcomepage_name;" />
      </File>
</Module>
<Module Name="Test2" Url="$Resources:osrvcore,List_Pages_UrlName;" Path="">
      <File Url="default2.aspx" Type="GhostableInLibrary" Level="Draft">
          <Property Name="Title" Value="Test2" />
          <Property Name="PublishingPageLayout" Value="~SiteCollection/_catalogs/masterpage/WelcomeLinks.aspx, $Resources:cmscore,PageLayout_WelcomeLinks_Title;" />
          <Property Name="ContentType" Value="$Resources:cmscore,contenttype_welcomepage_name;" />
      </File>
</Module>

Does anyone know if this is possible to do as at the moment I am getting the following results

Just shows default and default2

do need to set a param to name the file something different when its being provisioned?

share|improve this question
add comment

1 Answer

up vote 0 down vote accepted

this can be done by using the name attribute on the file

eg

 <Module Name="Test" Url="$Resources:osrvcore,List_Pages_UrlName;" Path="">
      <File Name="Test.aspx" Url="default2.aspx" Type="GhostableInLibrary" Level="Draft">
          <Property Name="Title" Value="LPAGloucester" />
          <Property Name="PublishingPageLayout" Value="~SiteCollection/_catalogs/masterpage/WelcomeLinks.aspx, $Resources:cmscore,PageLayout_WelcomeLinks_Title;" />
          <Property Name="ContentType" Value="$Resources:cmscore,contenttype_welcomepage_name;" />
      </File>
</Module>
<Module Name="Test2" Url="$Resources:osrvcore,List_Pages_UrlName;" Path="">
      <File Name="Test2.aspx" Url="default2.aspx" Type="GhostableInLibrary" Level="Draft" >
          <Property Name="Title" Value="LPACheltenham" />
          <Property Name="PublishingPageLayout" Value="~SiteCollection/_catalogs/masterpage/WelcomeLinks.aspx, $Resources:cmscore,PageLayout_WelcomeLinks_Title;" />
          <Property Name="ContentType" Value="$Resources:cmscore,contenttype_welcomepage_name;" />
      </File>
</Module>

just remember to place the aspx on the end of the file name :-)

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.