NuGet ยท nuget

Redeon.SuperSiteEngineCore.Web.Eltheon.Core.WebUi

Core Web UI integration contracts and tag helpers for Eltheon.

Install

Install-Kommandos

dotnet add package Redeon.SuperSiteEngineCore.Web.Eltheon.Core.WebUi --version 0.9.0.2
<PackageReference Include="Redeon.SuperSiteEngineCore.Web.Eltheon.Core.WebUi" Version="0.9.0.2" />
paket add Redeon.SuperSiteEngineCore.Web.Eltheon.Core.WebUi --version 0.9.0.2
Install-Package Redeon.SuperSiteEngineCore.Web.Eltheon.Core.WebUi -Version 0.9.0.2

README

Vorschau

Eltheon Core.WebUi

Redeon.SuperSiteEngineCore.Web.Eltheon.Core.WebUi is the neutral Web UI foundation package for Eltheon Razor hosts. It contains reusable TagHelpers, permission UI bridge types, navigation contracts, and optional Admin/User test pages.

The package is infrastructure. It must not reference the template or any concrete host project. Layouts, sidebars, header/footer markup, theme assets, and tag partial views stay owned by the host/template.

Install

Add the package to an Eltheon host or feature package:

<PackageReference Include="Redeon.SuperSiteEngineCore.Web.Eltheon.Core.WebUi" Version="0.9.0.2" />

Core.WebUi depends on:

  • Redeon.SuperSiteEngineCore.Web.Eltheon.Core.Features.Identity
  • Redeon.SuperSiteEngineCore.Web.Eltheon.Core.Features.Permissions
  • Microsoft.AspNetCore.App

Host Setup

Register Core.WebUi services in the host:

using Redeon.SuperSiteEngineCore.Web.Eltheon.Core.WebUi.v1.Extensions;

builder.Services.AddEltheonCoreWebUi(options =>
{
    options.EnableAdminTestPage = false;
    options.EnableUserTestPage = false;
    options.RegisterTestNavigation = false;
});

Register the Razor Class Library with the existing Razor Pages pipeline:

builder.Services
    .AddRazorPages()
    .AddEltheonCoreWebUiApplicationPart();

Do not create a second competing Razor Pages registration just for Core.WebUi.

Razor Imports

Add the Core.WebUi TagHelpers where Razor pages need them:

@addTagHelper *, Redeon.SuperSiteEngineCore.Web.Eltheon.Core.WebUi
@addTagHelper Redeon.SuperSiteEngineCore.Web.Eltheon.Core.WebUi.v1.TagHelpers.*, Redeon.SuperSiteEngineCore.Web.Eltheon.Core.WebUi
@addTagHelper Redeon.SuperSiteEngineCore.Web.Eltheon.Core.WebUi.v1.Security.*, Redeon.SuperSiteEngineCore.Web.Eltheon.Core.WebUi
@using Redeon.SuperSiteEngineCore.Web.Eltheon.Core.WebUi.v1.Navigation
@using Redeon.SuperSiteEngineCore.Web.Eltheon.Core.WebUi.v1.Security
@using Redeon.SuperSiteEngineCore.Web.Eltheon.Core.WebUi.v1.TagHelpers

TagHelpers

Core.WebUi provides the neutral Bootstrap-style TagHelpers under v1.TagHelpers:

  • BS:Container
  • BS:Row
  • BS:Column
  • BS:Card
  • BS:CardHeader
  • BS:CardBody
  • BS:CardFooter
  • BS:NavItem
  • BS:NavLink
  • BS:NavMenu
  • BS:NavMenuLink

Example:

<bs:Container type="fluid">
    <bs:Row class="g-3">
        <bs:Column md="6">
            <bs:Card header="Core.WebUi">
                <p>Rendered through Core.WebUi TagHelpers.</p>
            </bs:Card>
        </bs:Column>
    </bs:Row>
</bs:Container>

The C# TagHelpers live in this package. Concrete tag partial views remain template-owned.

Permissions

Core.WebUi does not create a second permission system. It provides a UI/security bridge that host projects adapt to their own permission manager.

Primary types:

  • IEltheonPermissionEvaluator
  • DenyAllPermissionEvaluator
  • PermissionAttribute
  • PermissionTagHelper
  • SecureContentTagHelper
  • CoreWebUiPermissionProvider

AddEltheonCoreWebUi(...) registers DenyAllPermissionEvaluator as the fallback evaluator. Real hosts should override it:

builder.Services.AddScoped<IEltheonPermissionEvaluator, TemplatePermissionEvaluator>();

Use [Permission] for server-side page or action protection:

[Permission("Core.WebUi.Test.Admin", PermType.R)]
public sealed class IndexModel : PageModel
{
}

Use permission TagHelpers only for conditional UI rendering:

<secure-content permission="Core.WebUi.Test.Admin" perm-type="R">
    <span>Visible only with read permission.</span>
</secure-content>

<button permission="Core.WebUi.Test.Admin" perm-type="W">
    Write action
</button>

Navigation filtering and conditional UI rendering are not security. Protected pages and actions must still enforce server-side authorization.

Feature packages can contribute area-neutral navigation by implementing IEltheonNavigationProvider:

public sealed class MyNavigationProvider : IEltheonNavigationProvider
{
    public IEnumerable<EltheonNavigationEntry> GetNavigationEntries()
    {
        yield return new EltheonNavigationEntry
        {
            Key = "my-feature.admin",
            Type = EltheonNavigationEntryType.Link,
            Area = "Admin",
            LabelKey = "MyFeature.Navigation.Admin",
            FallbackLabel = "My Feature",
            Icon = "extension",
            Page = "/MyFeature/Index",
            RequiredPermission = "MyFeature.Admin",
            RequiredPermissionType = PermType.R,
            Order = 500
        };
    }
}

Register providers with DI:

services.TryAddEnumerable(
    ServiceDescriptor.Singleton<IEltheonNavigationProvider, MyNavigationProvider>());

Hosts render entries through IEltheonNavigationRegistry:

  • GetEntries()
  • GetEntriesForArea(string area)

Supported entry types are:

  • Group
  • Link
  • Menu
  • MenuLink
  • Divider

EltheonNavigationEntry supports labels, tooltips, icons, Razor Page paths, direct URLs, badges, permissions, order, disabled state, external links, and active path prefixes.

Optional Test Pages

Core.WebUi includes two optional Razor Pages:

  • /Admin/CoreWebUiTest
  • /User/CoreWebUiTest

Enable them through options:

builder.Services.AddEltheonCoreWebUi(options =>
{
    options.EnableAdminTestPage = true;
    options.EnableUserTestPage = true;
    options.RegisterTestNavigation = true;
});

The Admin test page is protected by:

Core.WebUi.Test.Admin

CoreWebUiPermissionProvider contributes that permission to the existing Permissions feature. The default admin grant is read permission.

Localization

Core.WebUi contains ResX resources only for its own test pages and generic integration labels. Feature-specific resources belong to the feature package. Shell resources belong to the host/template.

Hosts that use the Eltheon composite localizer must include the Core.WebUi assembly as an additional localization assembly so ResourceManager can resolve Core.WebUi resources:

featureAssemblies.Add(typeof(EltheonCoreWebUiMarker).Assembly);

SimpleSearch

Core.WebUi does not rebuild SimpleSearch. The included test pages expose the existing SimpleSearch metadata keys in their Razor code and resources:

  • Meta_SimpleSearch_Title
  • Meta_SimpleSearch_Keywords
  • Meta_SimpleSearch_Description

After enabling the test pages or changing their resources, trigger the existing SimpleSearch indexing service so the in-memory index is refreshed.

Packaging

Core.WebUi is packable and follows the same local package flow as the existing Eltheon core packages.

dotnet pack Redeon.SuperSiteEngineCore.Web.Eltheon.Core.WebUi\Redeon.SuperSiteEngineCore.Web.Eltheon.Core.WebUi.csproj -c Release

The project invokes PostNuget.ps1 after packing on Windows and passes the active configuration, package id, and version so only the current Core.WebUi package is pushed.

Boundaries

Core.WebUi must not own:

  • concrete layouts or sidebars
  • theme assets
  • host permission storage
  • database migrations
  • plugin lifecycle
  • SimpleSearch architecture
  • a replacement localization system

Core.WebUi should remain a small, reusable contract and TagHelper package for Razor UI integration across Admin, User, and future Docs surfaces.