Open Closed

Unable to maintain the Branding Logo using BrandingProvider #9089


User avatar
0
DecisionTree.Dev created

I am trying to maintain the branding logo using the customized branding provider as below:
image.png

And I also have have the branding logo under the images folder

image.png
As you can see I have two logo-light.png files, one under lepton folder and the other one is directly under logo folder

However if i remove the one under lepton folder, the logo will be gone in the UI even though in the branding provider, the path is targeting /images/logo/logo-light.png, which is the one under logo folder
image.png

Any ideas how to fix this issue? Also we are trying to upgrade to leptonx theme, what would be the different with the solution before/after the leptonx theme upgrade? Thanks


5 Answer(s)
  • User Avatar
    0
    DecisionTree.Dev created

    Follow up:

    one thing i notice in the dev tool in the browser, the path of the logo is as below:
    image.png

    this is not matching the one in the branding provider, i am guessing i am missing something to make it work. Any ideas?

  • User Avatar
    0
    berkansasmaz created
    Support Team .NET Developer

    Hi,

    Can you [Dependency(ReplaceServices = true)] attribute on top of your branding provider like below:

    
    [Dependency(ReplaceServices = true)]
    public class BlazorWebiAppBrandingProvider : DefaultBrandingProvider
    {
        private IStringLocalizer<BlazorWebiApp9087Resource> _localizer;
    
        public BlazorWebiApp9087BrandingProvider(IStringLocalizer<BlazorWebiApp9087Resource> localizer)
        {
            _localizer = localizer;
        }
    
        public override string AppName => _localizer["AppName"];
    }
    

    You can also check this document if you are thinking of switching from Lepton to LeptonX.

  • User Avatar
    0
    DecisionTree.Dev created

    Hey Berkansasmaz, the class already comes with the [Dependency(ReplaceServices = true)] attribute by default I just didn't include that in the screenshot so I don't think this is helpful. Any other suggestions?

  • User Avatar
    0
    berkansasmaz created
    Support Team .NET Developer

    Hi,

    It’s possible that a rule in your CSS is overriding the branding logo. Could you please check your CSS files for any definitions that might affect the logo?

    For example, in a Blazor WebAssembly project that uses the LeptonX theme, the logo is defined via CSS variables like this:

    :root .lpx-theme-dim,
    :root .lpx-theme-dark {
        --lpx-logo: url('/images/logo/leptonx/icon.svg');
        --lpx-logo-icon: url('/images/logo/leptonx/icon.svg');
    }
    
    :root .lpx-theme-light {
        --lpx-logo: url('/images/logo/leptonx/icon.svg');
        --lpx-logo-icon: url('/images/logo/leptonx/icon.svg');
    }
    
    

    You can try updating these CSS variables to point to your own logo file to see if it solves the issue.

    If this does not resolve the issue, please send your application with the ticket number in an email to support@abp.io so that I can fix it in your code and inform you about the issue later.

  • User Avatar
    0
    DecisionTree.Dev created

    @berkansasmaz yeah I have tried the css already, will send the email shortly. Thanks

Boost Your Development
ABP Live Training
Packages
See Trainings
Mastering ABP Framework Book
Do you need assistance from an ABP expert?
Schedule a Meeting
Mastering ABP Framework Book
The Official Guide
Mastering
ABP Framework
Learn More
Mastering ABP Framework Book
Made with ❤️ on ABP v9.3.0-preview. Updated on April 11, 2025, 10:10