Using default autoroute patterns when none is provided

--HG--
branch : 1.x
This commit is contained in:
Sebastien Ros
2012-02-14 17:00:04 -08:00
parent c81f84587b
commit 721f9515fa
7 changed files with 19 additions and 14 deletions

View File

@@ -39,7 +39,11 @@ namespace Orchard.Blogs {
.WithPart("BlogPart")
.WithPart("CommonPart")
.WithPart("TitlePart")
.WithPart("AutoroutePart")
.WithPart("AutoroutePart", builder => builder
.WithSetting("AutorouteSettings.AllowCustomPattern", "true")
.WithSetting("AutorouteSettings.AutomaticAdjustmentOnEdit", "false")
.WithSetting("AutorouteSettings.PatternDefinitions", "[{Name:'Title', Pattern: '{Content.Slug}', Description: 'my-blog'}]")
.WithSetting("AutorouteSettings.DefaultPatternIndex", "0"))
.WithPart("MenuPart")
.WithPart("AdminMenuPart", p => p.WithSetting("AdminMenuPartTypeSettings.DefaultPosition", "2"))
);
@@ -51,7 +55,11 @@ namespace Orchard.Blogs {
.WithSetting("DateEditorSettings.ShowDateEditor", "true"))
.WithPart("PublishLaterPart")
.WithPart("TitlePart")
.WithPart("AutoroutePart")
.WithPart("AutoroutePart", builder => builder
.WithSetting("AutorouteSettings.AllowCustomPattern", "true")
.WithSetting("AutorouteSettings.AutomaticAdjustmentOnEdit", "false")
.WithSetting("AutorouteSettings.PatternDefinitions", "[{Name:'Blog and Title', Pattern: '{Content.Container.Path}/{Content.Slug}', Description: 'my-blog/my-post'}]")
.WithSetting("AutorouteSettings.DefaultPatternIndex", "0"))
.WithPart("BodyPart")
);

View File

@@ -2,8 +2,8 @@
AntiForgery: enabled
Author: The Orchard Team
Website: http://orchardproject.net
Version: 1.3.0
OrchardVersion: 1.3.0
Version: 1.4.0
OrchardVersion: 1.4.0
Description: The Orchard Blogs module is implementing basic blogging features.
FeatureDescription: A simple web log.
Dependencies: Shapes, Common, Feeds, Navigation, Orchard.Widgets, Orchard.jQuery, Orchard.PublishLater

View File

@@ -11,7 +11,11 @@ namespace Orchard.Pages {
.WithSetting("DateEditorSettings.ShowDateEditor", "true"))
.WithPart("PublishLaterPart")
.WithPart("TitlePart")
.WithPart("AutoroutePart")
.WithPart("AutoroutePart", builder => builder
.WithSetting("AutorouteSettings.AllowCustomPattern", "true")
.WithSetting("AutorouteSettings.AutomaticAdjustmentOnEdit", "false")
.WithSetting("AutorouteSettings.PatternDefinitions", "[{Name:'Title', Pattern: '{Content.Slug}', Description: 'my-page'}]")
.WithSetting("AutorouteSettings.DefaultPatternIndex", "0"))
.WithPart("BodyPart")
.Creatable());

View File

@@ -54,9 +54,6 @@
widget create HtmlWidget /Title:"Third Leader Aside" /Zone:"TripelThird" /Position:"5" /Layer:"TheHomepage" /Identity:"SetupHtmlWidget3" /UseLoremIpsumText:true
site setting set baseurl
theme activate "The Theme Machine"
autoroute create "Page" "Title" "{Content.Slug}" "about-us" true
autoroute create "Blog" "Title" "{Content.Slug}" "my-blog" true
autoroute create "BlogPost" "Blog and Title" "{Content.Container.Path}/{Content.Slug}" "my-blog/a-blog-post" true
blog create /Title:"Blog" /Homepage:true /Description:"This is your Orchard Blog."
menuitem create /MenuPosition:"1" /MenuText:"Home" /Url:"" /OnMainMenu:true
</Command>

View File

@@ -26,7 +26,6 @@
<Migration features="*" />
<Command>
autoroute create "Page" "Title" "{Content.Slug}" "about-us" true
page create /Slug:"welcome-to-orchard" /Title:"Welcome to Orchard!" /Path:"welcome-to-orchard" /Homepage:true /Publish:true /Text:"Welcome To Orchard!"
menuitem create /MenuPosition:"1" /MenuText:"Home" /Url:"" /OnMainMenu:true
</Command>

View File

@@ -49,9 +49,6 @@
widget create HtmlWidget /Title:"Second Leader Aside" /Zone:"TripelSecond" /Position:"5" /Layer:"TheHomepage" /Identity:"SetupHtmlWidget2" /UseLoremIpsumText:true
widget create HtmlWidget /Title:"Third Leader Aside" /Zone:"TripelThird" /Position:"5" /Layer:"TheHomepage" /Identity:"SetupHtmlWidget3" /UseLoremIpsumText:true
site setting set baseurl
autoroute create "Page" "Title" "{Content.Slug}" "about-us" true
autoroute create "Blog" "Title" "{Content.Slug}" "my-blog" true
autoroute create "BlogPost" "Blog and Title" "{Content.Container.Path}/{Content.Slug}" "my-blog/a-blog-post" true
page create /Slug:"welcome-to-orchard" /Title:"Welcome to Orchard!" /Path:"welcome-to-orchard" /Homepage:true /Publish:true /UseWelcomeText:true
menuitem create /MenuPosition:"1" /MenuText:"Home" /Url:"" /OnMainMenu:true
theme activate "The Theme Machine"