From 3afded6f608761110057268114c4ab09df8af291 Mon Sep 17 00:00:00 2001 From: Enis Necipoglu Date: Wed, 13 Mar 2024 08:29:24 +0300 Subject: [PATCH 1/6] Add PageTitle to PageHeader component --- .../Layout/PageHeader.razor | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/framework/src/Volo.Abp.AspNetCore.Components.Web.Theming/Layout/PageHeader.razor b/framework/src/Volo.Abp.AspNetCore.Components.Web.Theming/Layout/PageHeader.razor index 2bb222feb87..d0b11843c1f 100644 --- a/framework/src/Volo.Abp.AspNetCore.Components.Web.Theming/Layout/PageHeader.razor +++ b/framework/src/Volo.Abp.AspNetCore.Components.Web.Theming/Layout/PageHeader.razor @@ -1,11 +1,13 @@ @using Blazorise @using Microsoft.Extensions.Options +@using Microsoft.AspNetCore.Components.Web @inject IOptions Options + @PageLayout.Title @if(Options.Value.RenderPageTitle) - { + {

@PageLayout.Title

From 34e0fc4bc33924d89c30b3b62cf1cb84fae81a3b Mon Sep 17 00:00:00 2001 From: Enis Necipoglu Date: Wed, 13 Mar 2024 08:29:56 +0300 Subject: [PATCH 2/6] Add HeadOutlet to templates --- .../Client/MyProjectNameBlazorModule.cs | 3 ++- .../MyProjectNameBlazorModule.cs | 3 ++- .../MyProjectNameBlazorHostModule.cs | 2 ++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Blazor.WebAssembly/Client/MyProjectNameBlazorModule.cs b/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Blazor.WebAssembly/Client/MyProjectNameBlazorModule.cs index 9589da2db77..8c09da70e84 100644 --- a/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Blazor.WebAssembly/Client/MyProjectNameBlazorModule.cs +++ b/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Blazor.WebAssembly/Client/MyProjectNameBlazorModule.cs @@ -1,5 +1,6 @@ using Blazorise.Bootstrap5; using Blazorise.Icons.FontAwesome; +using Microsoft.AspNetCore.Components.Web; using Microsoft.AspNetCore.Components.WebAssembly.Hosting; using MyCompanyName.MyProjectName.Menus; using MyCompanyName.MyProjectName; @@ -121,7 +122,7 @@ private static void ConfigureAuthentication(WebAssemblyHostBuilder builder) private static void ConfigureUI(WebAssemblyHostBuilder builder) { builder.RootComponents.Add("#ApplicationContainer"); - + builder.RootComponents.Add("head::after"); } private static void ConfigureHttpClient(ServiceConfigurationContext context, IWebAssemblyHostEnvironment environment) diff --git a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor/MyProjectNameBlazorModule.cs b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor/MyProjectNameBlazorModule.cs index 5d955fd6c1b..d67fdea8bc2 100644 --- a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor/MyProjectNameBlazorModule.cs +++ b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor/MyProjectNameBlazorModule.cs @@ -2,6 +2,7 @@ using System.Net.Http; using Blazorise.Bootstrap5; using Blazorise.Icons.FontAwesome; +using Microsoft.AspNetCore.Components.Web; using Microsoft.AspNetCore.Components.WebAssembly.Hosting; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; @@ -86,7 +87,7 @@ private static void ConfigureAuthentication(WebAssemblyHostBuilder builder) private static void ConfigureUI(WebAssemblyHostBuilder builder) { builder.RootComponents.Add("#ApplicationContainer"); - + builder.RootComponents.Add("head::after"); } private static void ConfigureHttpClient(ServiceConfigurationContext context, IWebAssemblyHostEnvironment environment) diff --git a/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.Blazor.Host/MyProjectNameBlazorHostModule.cs b/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.Blazor.Host/MyProjectNameBlazorHostModule.cs index 5ec65f694e7..3e8f3a24d2a 100644 --- a/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.Blazor.Host/MyProjectNameBlazorHostModule.cs +++ b/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.Blazor.Host/MyProjectNameBlazorHostModule.cs @@ -2,6 +2,7 @@ using System.Net.Http; using Blazorise.Bootstrap5; using Blazorise.Icons.FontAwesome; +using Microsoft.AspNetCore.Components.Web; using Microsoft.AspNetCore.Components.WebAssembly.Hosting; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; @@ -80,6 +81,7 @@ private static void ConfigureAuthentication(WebAssemblyHostBuilder builder) private static void ConfigureUI(WebAssemblyHostBuilder builder) { builder.RootComponents.Add("#ApplicationContainer"); + builder.RootComponents.Add("head::after"); } private static void ConfigureHttpClient(ServiceConfigurationContext context, IWebAssemblyHostEnvironment environment) From e6c3089ccf4195e52c9ff067e9a8510113b41be6 Mon Sep 17 00:00:00 2001 From: Enis Necipoglu Date: Wed, 13 Mar 2024 08:30:11 +0300 Subject: [PATCH 3/6] Add default PageTitle to templates --- .../Pages/Index.razor | 3 +++ .../Pages/Index.razor | 3 +++ .../src/MyCompanyName.MyProjectName.Blazor/Pages/Index.razor | 3 +++ 3 files changed, 9 insertions(+) diff --git a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server.Tiered/Pages/Index.razor b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server.Tiered/Pages/Index.razor index 6a4c2c8d6e4..4fefed14ca3 100644 --- a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server.Tiered/Pages/Index.razor +++ b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server.Tiered/Pages/Index.razor @@ -2,6 +2,9 @@ @using Volo.Abp.MultiTenancy @inherits MyProjectNameComponentBase @inject AuthenticationStateProvider AuthenticationStateProvider + +Index +
diff --git a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server/Pages/Index.razor b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server/Pages/Index.razor index 543054d1c16..1f743978dbf 100644 --- a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server/Pages/Index.razor +++ b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server/Pages/Index.razor @@ -2,6 +2,9 @@ @using Volo.Abp.MultiTenancy @inherits MyProjectNameComponentBase @inject AuthenticationStateProvider AuthenticationStateProvider + +Index +
diff --git a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor/Pages/Index.razor b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor/Pages/Index.razor index 3cd56e9cac8..367638fcde7 100644 --- a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor/Pages/Index.razor +++ b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor/Pages/Index.razor @@ -2,6 +2,9 @@ @using Volo.Abp.MultiTenancy @inherits MyProjectNameComponentBase @inject AuthenticationStateProvider AuthenticationStateProvider + +Index +
From 0a18e0622b17ea17340bd8bb7d8634b39e1148d3 Mon Sep 17 00:00:00 2001 From: Enis Necipoglu Date: Wed, 13 Mar 2024 08:55:15 +0300 Subject: [PATCH 4/6] Add HeadOutlet to Blazor Server projects --- .../Pages/_Host.cshtml | 1 + .../MyCompanyName.MyProjectName.Blazor.Server/Pages/_Host.cshtml | 1 + .../Pages/_Host.cshtml | 1 + .../MyCompanyName.MyProjectName.Blazor.Server/Pages/_Host.cshtml | 1 + .../Pages/_Host.cshtml | 1 + 5 files changed, 5 insertions(+) diff --git a/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Blazor.Server.Mongo/Pages/_Host.cshtml b/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Blazor.Server.Mongo/Pages/_Host.cshtml index 88b72298ab0..5197829f3e6 100644 --- a/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Blazor.Server.Mongo/Pages/_Host.cshtml +++ b/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Blazor.Server.Mongo/Pages/_Host.cshtml @@ -18,6 +18,7 @@ + diff --git a/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Blazor.Server/Pages/_Host.cshtml b/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Blazor.Server/Pages/_Host.cshtml index 88b72298ab0..5197829f3e6 100644 --- a/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Blazor.Server/Pages/_Host.cshtml +++ b/templates/app-nolayers/aspnet-core/MyCompanyName.MyProjectName.Blazor.Server/Pages/_Host.cshtml @@ -18,6 +18,7 @@ + diff --git a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server.Tiered/Pages/_Host.cshtml b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server.Tiered/Pages/_Host.cshtml index 99c69585b87..ffee2586a46 100644 --- a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server.Tiered/Pages/_Host.cshtml +++ b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server.Tiered/Pages/_Host.cshtml @@ -18,6 +18,7 @@ + diff --git a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server/Pages/_Host.cshtml b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server/Pages/_Host.cshtml index a61ceaef9a9..9f37822a7b2 100644 --- a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server/Pages/_Host.cshtml +++ b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server/Pages/_Host.cshtml @@ -18,6 +18,7 @@ + diff --git a/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.Blazor.Server.Host/Pages/_Host.cshtml b/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.Blazor.Server.Host/Pages/_Host.cshtml index 5058f06366e..ad0719541b6 100644 --- a/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.Blazor.Server.Host/Pages/_Host.cshtml +++ b/templates/module/aspnet-core/host/MyCompanyName.MyProjectName.Blazor.Server.Host/Pages/_Host.cshtml @@ -18,6 +18,7 @@ + From 09be568ee24f5189fb3b4bb2b972f1cf31447d2f Mon Sep 17 00:00:00 2001 From: Enis Necipoglu Date: Wed, 13 Mar 2024 09:42:54 +0300 Subject: [PATCH 5/6] Remove PageTitle from Index pages --- .../Pages/Index.razor | 2 -- .../src/MyCompanyName.MyProjectName.Blazor/Pages/Index.razor | 2 -- 2 files changed, 4 deletions(-) diff --git a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server.Tiered/Pages/Index.razor b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server.Tiered/Pages/Index.razor index 4fefed14ca3..105cb10da7f 100644 --- a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server.Tiered/Pages/Index.razor +++ b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor.Server.Tiered/Pages/Index.razor @@ -3,8 +3,6 @@ @inherits MyProjectNameComponentBase @inject AuthenticationStateProvider AuthenticationStateProvider -Index -
diff --git a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor/Pages/Index.razor b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor/Pages/Index.razor index 367638fcde7..c50cdb96abe 100644 --- a/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor/Pages/Index.razor +++ b/templates/app/aspnet-core/src/MyCompanyName.MyProjectName.Blazor/Pages/Index.razor @@ -3,8 +3,6 @@ @inherits MyProjectNameComponentBase @inject AuthenticationStateProvider AuthenticationStateProvider -Index -
From 5478f6d9de58d2f835ce170383e75e9951167300 Mon Sep 17 00:00:00 2001 From: Enis Necipoglu Date: Wed, 13 Mar 2024 09:43:08 +0300 Subject: [PATCH 6/6] Render AppName in page title --- .../Layout/PageHeader.razor | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/framework/src/Volo.Abp.AspNetCore.Components.Web.Theming/Layout/PageHeader.razor b/framework/src/Volo.Abp.AspNetCore.Components.Web.Theming/Layout/PageHeader.razor index d0b11843c1f..d7c636d5d2a 100644 --- a/framework/src/Volo.Abp.AspNetCore.Components.Web.Theming/Layout/PageHeader.razor +++ b/framework/src/Volo.Abp.AspNetCore.Components.Web.Theming/Layout/PageHeader.razor @@ -1,11 +1,22 @@ @using Blazorise @using Microsoft.Extensions.Options @using Microsoft.AspNetCore.Components.Web +@using Volo.Abp.Ui.Branding @inject IOptions Options +@inject IBrandingProvider BrandingProvider - @PageLayout.Title + + @if (PageLayout.Title.IsNullOrEmpty()) + { + @BrandingProvider.AppName + } + else + { + @PageLayout.Title | @BrandingProvider.AppName + } + @if(Options.Value.RenderPageTitle) {