diff --git a/.all-contributorsrc b/.all-contributorsrc index e92f45f6f69..d323f7c0164 100644 --- a/.all-contributorsrc +++ b/.all-contributorsrc @@ -2834,6 +2834,33 @@ "contributions": [ "code" ] + }, + { + "login": "aliamiras", + "name": "aliamiras", + "avatar_url": "https://avatars.githubusercontent.com/u/107989021?v=4", + "profile": "https://github.com/aliamiras", + "contributions": [ + "code" + ] + }, + { + "login": "xtomas", + "name": "Tomáš Jákl", + "avatar_url": "https://avatars.githubusercontent.com/u/10938220?v=4", + "profile": "https://github.com/xtomas", + "contributions": [ + "code" + ] + }, + { + "login": "porgabi", + "name": "Gábor Pór", + "avatar_url": "https://avatars.githubusercontent.com/u/51411356?v=4", + "profile": "https://github.com/porgabi", + "contributions": [ + "code" + ] } ], "skipCi": true, diff --git a/README.md b/README.md index 779d6ed855b..a0f2367eb96 100644 --- a/README.md +++ b/README.md @@ -55,7 +55,7 @@ Do you need some help with Orchard Core? Don't worry, there are ways to get help - [X (Twitter)](https://twitter.com/orchardcms) - [LinkedIn](https://www.linkedin.com/groups/13605669/) -- [Meta (Facebook)](https://www.facebook.com/groups/244928199422062/user/100063629920864) +- [Meta (Facebook)](https://www.facebook.com/OrchardCore) ## Local Communities @@ -82,6 +82,16 @@ First, clone the repository using the command `git clone https://github.com/Orch 2. Launch the solution by clicking on `OrchardCore.sln`. Give Visual Studio time to restore all missing Nuget packages. 3. Ensure `OrchardCore.Cms.Web` is set as the startup project. Then run the app. +## Preview Package Feed + +[![Hosted By: Cloudsmith](https://img.shields.io/badge/OSS%20hosting%20by-cloudsmith-blue?logo=cloudsmith&style=for-the-badge)](https://cloudsmith.com) + +NuGet package repository hosting for the preview feed is graciously provided by [Cloudsmith](https://cloudsmith.com). + +Cloudsmith is the only fully hosted, cloud-native, universal package management solution, that +enables your organization to create, store, and share packages in any format, to any place, with total +confidence. + ## Code of Conduct See [our Code of Conduct](./CODE-OF-CONDUCT.md). diff --git a/src/OrchardCore.Build/Dependencies.props b/src/OrchardCore.Build/Dependencies.props index 421125a4e7e..2ffddecbbf7 100644 --- a/src/OrchardCore.Build/Dependencies.props +++ b/src/OrchardCore.Build/Dependencies.props @@ -21,13 +21,14 @@ - + - + + diff --git a/src/OrchardCore.Modules/OrchardCore.Admin/Startup.cs b/src/OrchardCore.Modules/OrchardCore.Admin/Startup.cs index 7d08f46eabb..fee003ba35f 100644 --- a/src/OrchardCore.Modules/OrchardCore.Admin/Startup.cs +++ b/src/OrchardCore.Modules/OrchardCore.Admin/Startup.cs @@ -1,4 +1,6 @@ using System; +using Fluid; +using Fluid.Values; using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Mvc; using Microsoft.AspNetCore.Mvc.ApplicationModels; @@ -9,10 +11,13 @@ using OrchardCore.Admin.Controllers; using OrchardCore.Admin.Drivers; using OrchardCore.Admin.Models; +using OrchardCore.DisplayManagement; using OrchardCore.DisplayManagement.Handlers; +using OrchardCore.DisplayManagement.ModelBinding; using OrchardCore.DisplayManagement.Theming; using OrchardCore.Environment.Shell.Configuration; using OrchardCore.Environment.Shell.Scope; +using OrchardCore.Liquid; using OrchardCore.Modules; using OrchardCore.Mvc.Core.Utilities; using OrchardCore.Mvc.Routing; @@ -93,4 +98,38 @@ public override void ConfigureServices(IServiceCollection services) services.AddSiteSettingsPropertyDeploymentStep(S => S["Admin settings"], S => S["Exports the admin settings."]); } } + + [RequireFeatures("OrchardCore.Liquid")] + public class LiquidStartup : StartupBase + { + public override void ConfigureServices(IServiceCollection services) + { + services.Configure(o => + { + o.Scope.SetValue(nameof(Navbar), new FunctionValue(async (args, ctx) => + { + if (ctx is LiquidTemplateContext context) + { + var displayManager = context.Services.GetRequiredService>(); + var updateModelAccessor = context.Services.GetRequiredService(); + + var shape = await displayManager.BuildDisplayAsync(updateModelAccessor.ModelUpdater); + + return FluidValue.Create(shape, ctx.Options); + } + + return NilValue.Instance; + })); + + o.MemberAccessStrategy.Register((navbar, name, context) => + { + return name switch + { + nameof(Navbar.Properties) => new ObjectValue(navbar.Properties), + _ => NilValue.Instance + }; + }); + }); + } + } } diff --git a/src/OrchardCore.Modules/OrchardCore.Admin/Views/Navbar.cshtml b/src/OrchardCore.Modules/OrchardCore.Admin/Views/Navbar.cshtml index 91b5f1d422d..81684dd717b 100644 --- a/src/OrchardCore.Modules/OrchardCore.Admin/Views/Navbar.cshtml +++ b/src/OrchardCore.Modules/OrchardCore.Admin/Views/Navbar.cshtml @@ -1,6 +1,20 @@ +@using OrchardCore.Admin.Models +@using OrchardCore.DisplayManagement +@using OrchardCore.DisplayManagement.ModelBinding + +@inject IDisplayManager DisplayManager +@inject IUpdateModelAccessor UpdateModelAccessor + @if (Model.Content == null) { - return; + dynamic shape = await DisplayAsync(await DisplayManager.BuildDisplayAsync(UpdateModelAccessor.ModelUpdater, (string)Model.Metadata.DisplayType)); + + if (shape.Content == null) + { + return; + } + + Model.Content = shape.Content; }