Activities of "liangshiwei"

Hi,

I could not reproduce the problem, could you share a project that can reproduce the problem with me? shiwei.liang@volosoft.com

HI,

I will check it

Hi,

Sorry I could not reproduce the problem, could you use the suite to create a new project to reproduce and share with me? shiwei.liang@volosoft.com. thanks.

Hi,

Try the following steps:

  • Add lang-initializer.js and style-initializer.js files to the Blazor's wwwroot folder
  • Update the BundleContributor
  • Run dotnet build and abp bundle

lang-initializer.js

window.afterLeptonXInitialization = function() {

    console.log("afterLeptonXInitialization");
    var isRtl = JSON.parse(localStorage.getItem("Abp.IsRtl"));
    var direction = isRtl ? "rtl" : "ltr";

    replaceStyleWith(
        createStyleUrl('layout-bundle', direction),
        `lpx-layout-bundle-style-${direction}`,
        `lpx-layout-bundle-style-${direction === 'rtl' ? 'ltr' : 'rtl'}`
    );
    replaceStyleWith(
        createStyleUrl('abp-bundle', direction),
        `lpx-abp-bundle-style-${direction}`,
        `lpx-abp-bundle-style-${direction === 'rtl' ? 'ltr' : 'rtl'}`
    );
    replaceStyleWith(
        createStyleUrl('blazor-bundle', direction),
        `lpx-blazor-bundle-style-${direction}`,
        `lpx-blazor-bundle-style-${direction === 'rtl' ? 'ltr' : 'rtl'}`
    );
    replaceStyleWith(
        createStyleUrl('font-bundle', direction),
        `lpx-font-bundle-style-${direction}`,
        `lpx-font-bundle-style-${direction === 'rtl' ? 'ltr' : 'rtl'}`
    );


    function createStyleUrl(theme, direction='ltr') {
        const styleName = direction === 'rtl' ? `${theme}.rtl` : theme;
        return `_content/Volo.Abp.AspNetCore.Components.Web.LeptonXTheme/${window.currentLayout}/css/${styleName}.css`
    }

    function createId(theme, type) {
        return theme && `lpx-theme-${type}-${theme}`;
    }

    function replaceStyleWith(path, id, previousId) {
        const link = document.createElement('link');
        link.href = path;
        link.type = 'text/css';
        link.rel = 'stylesheet';
        link.id = id;
        const prevElem = document.querySelector(`#${previousId}`);
        document.getElementsByTagName('head')[0].appendChild(link);
        if (previousId) {
            prevElem?.remove();
        }
        return link;
    }

    function loadThemeCSS(key, theme, themeOld, cssPrefix, direction='ltr') {
        const themeId = createId(theme, key);
        const previousThemeId = createId(themeOld, key);

        replaceStyleWith(createStyleUrl(cssPrefix + theme, direction), themeId, previousThemeId);
    }
};

style-initializer.js

window.afterLeptonXInitialization = function() {

    console.log("afterLeptonXInitialization");
    var isRtl = JSON.parse(localStorage.getItem("Abp.IsRtl"));
    var direction = isRtl ? "rtl" : "ltr";

    replaceStyleWith(
        createStyleUrl('layout-bundle', direction),
        `lpx-layout-bundle-style-${direction}`,
        `lpx-layout-bundle-style-${direction === 'rtl' ? 'ltr' : 'rtl'}`
    );
    replaceStyleWith(
        createStyleUrl('abp-bundle', direction),
        `lpx-abp-bundle-style-${direction}`,
        `lpx-abp-bundle-style-${direction === 'rtl' ? 'ltr' : 'rtl'}`
    );
    replaceStyleWith(
        createStyleUrl('blazor-bundle', direction),
        `lpx-blazor-bundle-style-${direction}`,
        `lpx-blazor-bundle-style-${direction === 'rtl' ? 'ltr' : 'rtl'}`
    );
    replaceStyleWith(
        createStyleUrl('font-bundle', direction),
        `lpx-font-bundle-style-${direction}`,
        `lpx-font-bundle-style-${direction === 'rtl' ? 'ltr' : 'rtl'}`
    );


    function createStyleUrl(theme, direction='ltr') {
        const styleName = direction === 'rtl' ? `${theme}.rtl` : theme;
        return `_content/Volo.Abp.AspNetCore.Components.Web.LeptonXTheme/${window.currentLayout}/css/${styleName}.css`
    }

    function createId(theme, type) {
        return theme && `lpx-theme-${type}-${theme}`;
    }

    function replaceStyleWith(path, id, previousId) {
        const link = document.createElement('link');
        link.href = path;
        link.type = 'text/css';
        link.rel = 'stylesheet';
        link.id = id;
        const prevElem = document.querySelector(`#${previousId}`);
        document.getElementsByTagName('head')[0].appendChild(link);
        if (previousId) {
            prevElem?.remove();
        }
        return link;
    }

    function loadThemeCSS(key, theme, themeOld, cssPrefix, direction='ltr') {
        const themeId = createId(theme, key);
        const previousThemeId = createId(themeOld, key);

        replaceStyleWith(createStyleUrl(cssPrefix + theme, direction), themeId, previousThemeId);
    }
};

[YourProjectName]BundleContributor

public class [YourProjectName]BundleContributor : IBundleContributor
{
    public void AddScripts(BundleContext context)
    {
        context.BundleDefinitions.RemoveAll(x => x.Source.Contains("lang-initializer.js"));
        context.BundleDefinitions.RemoveAll(x => x.Source.Contains("style-initializer.js"));

        context.Add("lang-initializer.js");
        context.Add("style-initializer.js");
    }

    public void AddStyles(BundleContext context)
    {
        context.Add("main.css", true);
    }
}

PS, don't forget to update the appsettings.json file of DbMigrator project to update the Blazor project's RootUrl and update the database table.

HI,

I will check it

Hi,

You can custom the Tenant resolver instead of AppService , see: https://docs.abp.io/en/abp/latest/Multi-Tenancy#custom-tenant-resolvers

Hi,

Sorry for later, I could not reproduce the problem, can you share a project that can reproduce the problem with me? shiwei.liang@volosoft.com

Can you try clearing the browser cookies or open a private window to try again?

Hi,

It's a problem, we will fix it in the next version. your ticket was refunded.

Please email me: shiwei.liang@volosoft.com, I will share the temporary solution code with you.

I will check it out

Showing 4571 to 4580 of 6693 entries
Boost Your Development
ABP Live Training
Packages
See Trainings
Mastering ABP Framework Book
The Official Guide
Mastering
ABP Framework
Learn More
Mastering ABP Framework Book
Made with ❤️ on ABP v10.1.0-preview. Updated on November 07, 2025, 08:20