Activities of "Spospisil"

Any update?

Hi,

I have created a private repo on github for you to view, however currently it's not working/running as typically a generated solution using abp tools does not work without coding changes. I have made my specific changes to demostrate the issue but can't really go any further with it until you tell me why I can run this solution that was produced by abp studio.

You should have received an invite to the repo.

Any update on this?

Hi,

So you can disregard this last comment as I tracked down the logic and see that I needed to create my own ToolbarContributor that specificaly look at the LeptonXThemeBlazorOptions and factor in my DynamicLayoutPicker in order to add the SideMenuUserMenu component to the ToolBar.Items collection.

public class StructureToolbarContributor : IToolbarContributor
{
    public Task ConfigureToolbarAsync(IToolbarConfigurationContext context)
    {
        if (context.Toolbar.Name == StandardToolbars.Main)
        {
            var options = context.ServiceProvider.GetRequiredService<IOptions<LeptonXThemeBlazorOptions>>().Value;

            if (options.Layout == typeof(DynamicLayoutPicker))
            {
                context.Toolbar.Items.Add(new ToolbarItem(typeof(SideMenuUserMenu)));
            }

        }
        return Task.CompletedTask;
    }
}


Changes to the Blazor ABP Module class

        Configure<AbpToolbarOptions>(options =>
        {
            options.Contributors.Add(new LeptonXThemeToolbarContributor());
            options.Contributors.Add(new StructureToolbarContributor());
            //options.Contributors.Add(new MessageToolBarContributor());
        });

Thanks

Ok, so now it appears all the pages that still use the standard ABP SideMenuLayout layout are not adding the MainHeaderToolbarUserMenu component to upper right corner of the page.

Here is my code

DynamicLayoutPicker.razor

@inherits LayoutComponentBase

<LayoutView Layout="@CurrentLayout">
    @Body
</LayoutView>

DynamicLayoutPicker.razor.cs

using CFDataSystems.StructureCloud.Blazor.Themes.LeptonX.Layouts.TenantLayout;
using CFDataSystems.StructureCloud.Components.Layouts;
using Microsoft.AspNetCore.Components;
using Microsoft.AspNetCore.Components.Routing;
using System.Threading.Tasks;
using System;
using Volo.Abp.AspNetCore.Components.Web.LeptonXTheme.Components.ApplicationLayout;

namespace CFDataSystems.StructureCloud.Blazor.Themes.LeptonX.Layouts;

public partial class DynamicLayoutPicker : LayoutComponentBase, IDisposable
{
    [Inject] private NavigationManager _navManager { get; set; }
    public Type CurrentLayout { get; set; } = typeof(SideMenuLayout);

    protected override Task OnInitializedAsync()
    {
        _navManager.LocationChanged += OnLocationChanged;
        SetLayout(_navManager.Uri);
        return base.OnInitializedAsync();
    }

    public void Dispose()
    {
        _navManager.LocationChanged -= OnLocationChanged;
    }

    private void OnLocationChanged(object sender, LocationChangedEventArgs e)
    {
        SetLayout(e.Location);
    }

    private void SetLayout(string location)
    {
        Console.WriteLine($"***** CURRENT URL: {location} *****");

        if (location.Contains("tenant-procedure-list"))
        {
            CurrentLayout = typeof(ProceduresPageLayout);
            Console.WriteLine($"***** CURRENT Layout: ProceduresPageLayout *****");
        }
        else if (location.Contains("SampleTenantDefault"))
        {
            CurrentLayout = typeof(TenantDefaultLayout);
            Console.WriteLine($"***** CURRENT Layout: TenantDefaultLayout *****");
        }
        else
        {
            CurrentLayout = typeof(SideMenuLayout);
            Console.WriteLine($"***** CURRENT Layout: SideMenuLayout *****");
        }

        StateHasChanged();
    }
}

BlazorModule.cs

        Configure<LeptonXThemeBlazorOptions>(options =>
        {
            //options.Layout = LeptonXBlazorLayouts.SideMenu;
            options.Layout = typeof(DynamicLayoutPicker);
        });

<br> <br> <br> <br> <br> <br> <br>

Ok. Thank you! That solution worked as how I needed.

Ok. Thank you! That solution worked as how I needed.

This does not allow me to have some pages in my site to use the new application layout and the rest use the standard leptonx application layout. This globally replaces one layout with another and that’s not what I want to do. I need to define a new layout and have a couple of pages use the new layout and the rest the standard one

Here's what the appsettings.json file looks like in the for the /Blazor app for the deployed environment and below that is the one for our local environment which locally everything works.

{ "App": { "SelfUrl": "https://demo2.structurecloud.com/Blazor" }, "AuthServer": { "Authority": "https://demo2.structurecloud.com/Auth", "ClientId": "StructureCloud_Blazor", "ResponseType": "code" }, "RemoteServices": { "Default": { "BaseUrl": "https://demo2.structurecloud.com" }, "AbpAccountPublic": { "BaseUrl": "https://demo2.structurecloud.com" } }, "AbpCli": { "Bundle": { "Mode": "BundleAndMinify", /* Options: None, Bundle, BundleAndMinify */ "Name": "global", "Parameters": { "LeptonXTheme.Layout": "side-menu" } } } }

Local appsettings.json { "AuthServer": { "Authority": "https://localhost.structurecloud.com/Auth", "ClientId": "StructureCloud_Blazor", "ResponseType": "code" }, "RemoteServices": { "Default": { "BaseUrl": "https://localhost.structurecloud.com" }, "AbpAccountPublic": { "BaseUrl": "https://localhost.structurecloud.com" } }, "AbpCli": { "Bundle": { "Mode": "BundleAndMinify", /* Options: None, Bundle, BundleAndMinify */ "Name": "global", "Parameters": { "LeptonXTheme.Layout": "side-menu"

  }
}

} }

Can you be more specific as to which appsettings.json file I should be checking, since I've indicated in the original ticket that we are using a tiered solution?

The url is https://demo2.structurecloud.com/

Showing 71 to 80 of 288 entries
Learn More, Pay Less
33% OFF
All Trainings!
Get Your Deal
Mastering ABP Framework Book
The Official Guide
Mastering
ABP Framework
Learn More
Mastering ABP Framework Book
Made with ❤️ on ABP v10.0.0-preview. Updated on September 12, 2025, 10:20