add Enhanced Navigation option in Site Settings

This commit is contained in:
sbwalker
2025-11-25 14:43:51 -05:00
parent 44103c1311
commit fb6e8bb233
4 changed files with 57 additions and 8 deletions

View File

@@ -60,7 +60,7 @@
}
@((MarkupString)_headResources)
</head>
<body>
<body data-enhance-nav="@_enhancedNavigation.ToString().ToLower()">
@if (string.IsNullOrEmpty(_message))
{
@if (_renderMode == RenderModes.Static)
@@ -97,6 +97,7 @@
private string _renderMode = RenderModes.Interactive;
private string _runtime = Runtimes.Server;
private bool _prerender = true;
private bool _enhancedNavigation = true;
private string _fingerprint = "";
private int _visitorId = -1;
private string _antiForgeryToken = "";
@@ -141,6 +142,7 @@
_renderMode = site.RenderMode;
_runtime = site.Runtime;
_prerender = site.Prerender;
_enhancedNavigation = site.EnhancedNavigation;
_fingerprint = site.Fingerprint;
var cookieConsentSettings = SettingService.GetSetting(site.Settings, "CookieConsent", string.Empty);

View File

@@ -0,0 +1,29 @@
using Microsoft.EntityFrameworkCore.Infrastructure;
using Microsoft.EntityFrameworkCore.Migrations;
using Oqtane.Databases.Interfaces;
using Oqtane.Migrations.EntityBuilders;
using Oqtane.Repository;
namespace Oqtane.Migrations.Tenant
{
[DbContext(typeof(TenantDBContext))]
[Migration("Tenant.10.00.01.01")]
public class AddSiteEnhancedNavigation : MultiDatabaseMigration
{
public AddSiteEnhancedNavigation(IDatabase database) : base(database)
{
}
protected override void Up(MigrationBuilder migrationBuilder)
{
var siteEntityBuilder = new SiteEntityBuilder(migrationBuilder, ActiveDatabase);
siteEntityBuilder.AddBooleanColumn("EnhancedNavigation", true);
siteEntityBuilder.UpdateData("EnhancedNavigation", true);
}
protected override void Down(MigrationBuilder migrationBuilder)
{
// not implemented
}
}
}