mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-15 11:44:58 +08:00
Getting the main menu rendering again (from a fresh setup)
--HG-- branch : theming
This commit is contained in:
@@ -2,8 +2,16 @@
|
||||
// odd formatting in this file is to cause more attractive results in the output.
|
||||
var items = (IEnumerable<dynamic>)Enumerable.Cast<dynamic>(Model);
|
||||
}
|
||||
<li><a href="@Model.Href">@Model.Text</a>@{ if (items.Any()) {
|
||||
<ul>
|
||||
@foreach(var item in Model) {@Display(item);}
|
||||
</ul>}}
|
||||
</li>
|
||||
@{
|
||||
if (string.IsNullOrWhiteSpace((string)Model.Text)) {
|
||||
foreach(var item in Model) {@Display(item);}
|
||||
} else {
|
||||
<li><a href="@Model.Href">@Model.Text</a>
|
||||
@if (items.Any()) {
|
||||
<ul>
|
||||
@foreach(var item in Model) {@Display(item);}
|
||||
</ul>
|
||||
}
|
||||
</li>
|
||||
}
|
||||
}
|
@@ -6,6 +6,7 @@ using Orchard.ContentManagement.MetaData;
|
||||
using Orchard.Core.Common.Models;
|
||||
using Orchard.Core.Common.Settings;
|
||||
using Orchard.Core.Contents.Extensions;
|
||||
using Orchard.Core.Navigation.Models;
|
||||
using Orchard.Core.Routable.Models;
|
||||
using Orchard.Core.Settings.Descriptor.Records;
|
||||
using Orchard.Core.Settings.Models;
|
||||
@@ -71,7 +72,7 @@ namespace Orchard.Setup.Services {
|
||||
//"Reports",
|
||||
//"Feeds",
|
||||
"HomePage",
|
||||
//"Navigation",
|
||||
"Navigation",
|
||||
//"Scheduling",
|
||||
//"Indexing",
|
||||
//"Localization",
|
||||
@@ -228,11 +229,11 @@ namespace Orchard.Setup.Services {
|
||||
siteSettings.Record.HomePage = "RoutableHomePageProvider;" + page.Id;
|
||||
|
||||
// add a menu item for the shiny new home page
|
||||
//var menuItem = contentManager.Create("MenuItem");
|
||||
//menuItem.As<MenuPart>().MenuPosition = "1";
|
||||
//menuItem.As<MenuPart>().MenuText = T("Home").ToString();
|
||||
//menuItem.As<MenuPart>().OnMainMenu = true;
|
||||
//menuItem.As<MenuItemPart>().Url = "";
|
||||
var menuItem = contentManager.Create("MenuItem");
|
||||
menuItem.As<MenuPart>().MenuPosition = "1";
|
||||
menuItem.As<MenuPart>().MenuText = T("Home").ToString();
|
||||
menuItem.As<MenuPart>().OnMainMenu = true;
|
||||
menuItem.As<MenuItemPart>().Url = "";
|
||||
|
||||
//Temporary fix for running setup on command line
|
||||
if (HttpContext.Current != null) {
|
||||
|
Reference in New Issue
Block a user