2

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?

0

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 :-)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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