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
This commit is contained in:
Suha Can
2011-02-21 14:14:36 -08:00
parent 993849778f
commit 0db3f9777d
4 changed files with 13 additions and 6 deletions

View File

@@ -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:<slug> /Title:<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";

View File

@@ -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" />

View File

@@ -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

View File

@@ -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>