mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-21 03:14:10 +08:00
Making it so when a content item is set as the home page it's only accessible as the home page and not at its path
- current implication for blogs is that if a blog is set as the home page its posts are then all rooted (e.g. if a blog at /blog is set as the home page then it's available at / and a post at, say, /my-post instead of /blog/my-post). There should maybe be a setting to alter the paths of the posts but (1) that's a pain at the moment, (2) hacking the URL by removing the post slug would result in a 404 instead of redirecting to /, the path of the blog - we don't handle redirects of that nature - and (3) the ability to root a blog in this manner *has* been requested by some. --HG-- branch : dev
This commit is contained in:
@@ -281,8 +281,9 @@ namespace Orchard.Setup.Services {
|
||||
// create a welcome page that's promoted to the home page
|
||||
var page = contentManager.Create("Page", VersionOptions.Draft);
|
||||
page.As<RoutePart>().Title = T("Welcome to Orchard!").Text;
|
||||
page.As<RoutePart>().Path = "";
|
||||
page.As<RoutePart>().Slug = "";
|
||||
page.As<RoutePart>().Path = "welcome-to-orchard";
|
||||
page.As<RoutePart>().Slug = "welcome-to-orchard";
|
||||
page.As<RoutePart>().PromoteToHomePage = true;
|
||||
page.As<BodyPart>().Text = T(
|
||||
@"<p>You've successfully setup your Orchard Site and this is the homepage of your new site.
|
||||
Here are a few things you can look at to get familiar with the application.
|
||||
@@ -304,7 +305,6 @@ Modules are created by other users of Orchard just like you so if you feel up to
|
||||
<p>Thanks for using Orchard – The Orchard Team </p>", page.Id).Text;
|
||||
|
||||
contentManager.Publish(page);
|
||||
siteSettings.Record.HomePage = "RoutableHomePageProvider;" + page.Id;
|
||||
|
||||
// add a menu item for the shiny new home page
|
||||
var menuItem = contentManager.Create("MenuItem");
|
||||
|
Reference in New Issue
Block a user