From 0db3f9777dc0555a50331c2c298ba5e321aef123 Mon Sep 17 00:00:00 2001 From: Suha Can Date: Mon, 21 Feb 2011 14:14:36 -0800 Subject: [PATCH] Changing slug/title/description on the default blog created during execution of the blog recipe, adding a flag to the blog command handler for blog description. Change CMS recipe's name to Custom Content Site. --HG-- branch : recipe --- .../Modules/Orchard.Blogs/Commands/BlogCommands.cs | 11 +++++++++-- .../Modules/Orchard.Setup/Orchard.Setup.csproj | 2 +- .../Modules/Orchard.Setup/Recipes/blog.recipe.xml | 2 +- .../{cms.recipe.xml => customcontentsite.recipe.xml} | 4 ++-- 4 files changed, 13 insertions(+), 6 deletions(-) rename src/Orchard.Web/Modules/Orchard.Setup/Recipes/{cms.recipe.xml => customcontentsite.recipe.xml} (88%) diff --git a/src/Orchard.Web/Modules/Orchard.Blogs/Commands/BlogCommands.cs b/src/Orchard.Web/Modules/Orchard.Blogs/Commands/BlogCommands.cs index 8b15f19b5..4ef209897 100644 --- a/src/Orchard.Web/Modules/Orchard.Blogs/Commands/BlogCommands.cs +++ b/src/Orchard.Web/Modules/Orchard.Blogs/Commands/BlogCommands.cs @@ -2,6 +2,7 @@ using System.Linq; using System.Text.RegularExpressions; using System.Xml.Linq; +using Orchard.Blogs.Models; using Orchard.Commands; using Orchard.ContentManagement; using Orchard.ContentManagement.Aspects; @@ -47,6 +48,9 @@ namespace Orchard.Blogs.Commands { [OrchardSwitch] public string Title { get; set; } + [OrchardSwitch] + public string Description { get; set; } + [OrchardSwitch] public string MenuText { get; set; } @@ -54,8 +58,8 @@ namespace Orchard.Blogs.Commands { public bool Homepage { get; set; } [CommandName("blog create")] - [CommandHelp("blog create /Slug: /Title: [/Owner:<username>] [/MenuText:<menu text>] [/Homepage:true|false]\r\n\t" + "Creates a new Blog")] - [OrchardSwitches("Slug,Title,Owner,MenuText,Homepage")] + [CommandHelp("blog create /Slug:<slug> /Title:<title> [/Owner:<username>] [/Description:<description>] [/MenuText:<menu text>] [/Homepage:true|false]\r\n\t" + "Creates a new Blog")] + [OrchardSwitches("Slug,Title,Owner,Description,MenuText,Homepage")] public string Create() { if (String.IsNullOrEmpty(Owner)) { Owner = _siteService.GetSiteSettings().SuperUser; @@ -76,6 +80,9 @@ namespace Orchard.Blogs.Commands { blog.As<RoutePart>().Path = Slug; blog.As<RoutePart>().Title = Title; blog.As<RoutePart>().PromoteToHomePage = Homepage; + if (!String.IsNullOrEmpty(Description)) { + blog.As<BlogPart>().Description = Description; + } if ( !String.IsNullOrWhiteSpace(MenuText) ) { blog.As<MenuPart>().OnMainMenu = true; blog.As<MenuPart>().MenuPosition = _menuService.Get().Select(menuPart => menuPart.MenuPosition).Max() + 1 + ".0"; diff --git a/src/Orchard.Web/Modules/Orchard.Setup/Orchard.Setup.csproj b/src/Orchard.Web/Modules/Orchard.Setup/Orchard.Setup.csproj index b01477e6c..1701df8d9 100644 --- a/src/Orchard.Web/Modules/Orchard.Setup/Orchard.Setup.csproj +++ b/src/Orchard.Web/Modules/Orchard.Setup/Orchard.Setup.csproj @@ -77,7 +77,7 @@ <ItemGroup> <Content Include="Content\synchronizing.gif" /> <Content Include="Recipes\blog.recipe.xml" /> - <Content Include="Recipes\cms.recipe.xml" /> + <Content Include="Recipes\customcontentsite.recipe.xml" /> <Content Include="Recipes\minimal.recipe.xml" /> <Content Include="Scripts\setup.js" /> <Content Include="Views\Setup\Index.cshtml" /> diff --git a/src/Orchard.Web/Modules/Orchard.Setup/Recipes/blog.recipe.xml b/src/Orchard.Web/Modules/Orchard.Setup/Recipes/blog.recipe.xml index 8f81c1990..8d947163e 100644 --- a/src/Orchard.Web/Modules/Orchard.Setup/Recipes/blog.recipe.xml +++ b/src/Orchard.Web/Modules/Orchard.Setup/Recipes/blog.recipe.xml @@ -45,7 +45,7 @@ layer create /Name:"Anonymous" /LayerRule:"not authenticated" layer create /Name:"Disabled" /LayerRule:"false" layer create /Name:"TheHomepage" /LayerRule:"url '~/'" - blog create /Slug:"welcome-to-orchard" /Title:"Welcome to Orchard!" /Homepage:true + blog create /Slug:"blog" /Title:"Blog" /Homepage:true /Description:"This is your Orchard Blog." widget create /Type:"HtmlWidget" /Title:"First Leader Aside" /Zone:"TripelFirst" /Position:"5" /Layer:"TheHomepage" /UseLoremIpsumText:true widget create /Type:"HtmlWidget" /Title:"Second Leader Aside" /Zone:"TripelSecond" /Position:"5" /Layer:"TheHomepage" /UseLoremIpsumText:true widget create /Type:"HtmlWidget" /Title:"Third Leader Aside" /Zone:"TripelThird" /Position:"5" /Layer:"TheHomepage" /UseLoremIpsumText:true diff --git a/src/Orchard.Web/Modules/Orchard.Setup/Recipes/cms.recipe.xml b/src/Orchard.Web/Modules/Orchard.Setup/Recipes/customcontentsite.recipe.xml similarity index 88% rename from src/Orchard.Web/Modules/Orchard.Setup/Recipes/cms.recipe.xml rename to src/Orchard.Web/Modules/Orchard.Setup/Recipes/customcontentsite.recipe.xml index 3e45305ae..fd17b48b9 100644 --- a/src/Orchard.Web/Modules/Orchard.Setup/Recipes/cms.recipe.xml +++ b/src/Orchard.Web/Modules/Orchard.Setup/Recipes/customcontentsite.recipe.xml @@ -1,8 +1,8 @@ <?xml version="1.0"?> <Orchard> <Recipe> - <Name>CMS</Name> - <Description>A recipe providing an installation profile with the functionality for a generic CMS.</Description> + <Name>Custom Content Site</Name> + <Description>A recipe providing an installation profile with the functionality needed to create content-based custom sites.</Description> <Author>The Orchard Team</Author> <WebSite>http://orchardproject.net</WebSite> <Tags></Tags>