I need to know about create some custom pages in the time of creating a new web site, just like that Orchard default home page.
Can you please help me!
Dec 11, 2015 at 11:40 AM
Very easy, especially if you're on the dev branch. Simply create your pages, export them (including any referenced content items such as media items). The exported XML file is in fact a recipe (and when using the dev branch version you can even mark your
recipe as a Setup recipe so you don;t have to do this manually). Simply save your XML file with a filename ending in .recipe.xml in a folder called Recipes in your custom module (or the Orchard.Setup module). Checkout the existing recipes form the Orchard.Setup
module (Recipes folder) to see how the existing ones are setup. You could copy one of them and add your own pages to it. With that in place, simply delete your App_Data folder, run your site, and select your own recipe, and voila, your pages will be created
during setup. Give it a try and let me know if you have any questions.
Thank you so much!!!
Dec 16, 2015 at 11:02 AM
Edited Dec 16, 2015 at 11:19 AM
I have successfully created one Recipe just like:
<Description>The WebSite recipe includes pages, custom content types, comments, tags, widgets and basic navigation.</Description>
<Page ContentTypeSettings.Draftable="True" TypeIndexing.Indexes="Search">
<BlogPost ContentTypeSettings.Draftable="True" TypeIndexing.Indexes="Search">
<BodyPart BodyPartSettings.FlavorDefault="html" />
<Migration features="*" />
layer create Default /LayerRule:"true" /Description:"The widgets in this layer are displayed on all pages"
layer create Authenticated /LayerRule:"authenticated" /Description:"The widgets in this layer are displayed when the user is authenticated"
layer create Anonymous /LayerRule:"not authenticated" /Description:"The widgets in this layer are displayed when the user is anonymous"
layer create Disabled /LayerRule:"false" /Description:"The widgets in this layer are never displayed"
layer create TheHomepage /LayerRule:"url '~/'" /Description:"The widgets in this layer are displayed on the home page"
site setting set baseurl
menu create /MenuName:"Main Menu"
page create /Slug:"welcome-to-website" /Title:"Welcome to Website!" /Path:"welcome-to-website" /Homepage:true /Publish:true /UseWelcomeText:true
menuitem create /MenuPosition:"0" /MenuText:"Home" /Url:"~/" /MenuName:"Main Menu"
widget create MenuWidget /Title:"Main Menu" /RenderTitle:false /Zone:"Navigation" /Position:"1" /Layer:"Default" /Identity:"MenuWidget1" /MenuName:"Main Menu"
theme activate "My Default Theme"
but after applied this Recipe, Widget is not showing any layers:
Dec 16, 2015 at 11:38 AM
Edited Dec 16, 2015 at 1:40 PM
Sorry it's my mistake
I have forgot to add
Zones: Header, Navigation, Featured, BeforeMain, AsideFirst, Messages, BeforeContent, Content, AfterContent, AsideSecond, AfterMain, TripelFirst, TripelSecond, TripelThird, FooterQuadFirst, FooterQuadSecond, FooterQuadThird, FooterQuadFourth, Footer
now it's fixed!