This is the code to obtain and output the LogoURL in the Empty layout for MVC in LeptonX:
C:\ABP\LeptonX_422\src\Volo.Abp.AspNetCore.Mvc.UI.Theme.LeptonX\Themes\LeptonX\Layouts\Empty\Default.cshtml 33,9: var logoUrl = BrandingProvider.LogoUrl == null ? null : "--lpx-logo: url(" + BrandingProvider.LogoUrl + ");"; 33,36: var logoUrl = BrandingProvider.LogoUrl == null ? null : "--lpx-logo: url(" + BrandingProvider.LogoUrl + ");"; 33,99: var logoUrl = BrandingProvider.LogoUrl == null ? null : "--lpx-logo: url(" + BrandingProvider.LogoUrl + ");";
This implemetation allows the use of external URL's as it doesn't check what the string begins with.
The following implementations are on the other Layouts:
C:\ABP\LeptonX_422\src\Volo.Abp.AspNetCore.Mvc.UI.Theme.LeptonX\Themes\LeptonX\Layouts\Application\SideMenuLayout.cshtml 29,9: var logoUrl = BrandingProvider.LogoUrl == null ? null : "--lpx-logo: url(" + Url.Content(BrandingProvider.LogoUrl.EnsureStartsWith('/').EnsureStartsWith('~')) + ") !important;"; 29,36: var logoUrl = BrandingProvider.LogoUrl == null ? null : "--lpx-logo: url(" + Url.Content(BrandingProvider.LogoUrl.EnsureStartsWith('/').EnsureStartsWith('~')) + ") !important;"; 29,111: var logoUrl = BrandingProvider.LogoUrl == null ? null : "--lpx-logo: url(" + Url.Content(BrandingProvider.LogoUrl.EnsureStartsWith('/').EnsureStartsWith('~')) + ") !important;";
C:\ABP\LeptonX_422\src\Volo.Abp.AspNetCore.Mvc.UI.Theme.LeptonX\Themes\LeptonX\Layouts\Application\SideMenuLayout.cshtml 29,9: var logoUrl = BrandingProvider.LogoUrl == null ? null : "--lpx-logo: url(" + Url.Content(BrandingProvider.LogoUrl.EnsureStartsWith('/').EnsureStartsWith('~')) + ") !important;"; 29,36: var logoUrl = BrandingProvider.LogoUrl == null ? null : "--lpx-logo: url(" + Url.Content(BrandingProvider.LogoUrl.EnsureStartsWith('/').EnsureStartsWith('~')) + ") !important;"; 29,111: var logoUrl = BrandingProvider.LogoUrl == null ? null : "--lpx-logo: url(" + Url.Content(BrandingProvider.LogoUrl.EnsureStartsWith('/').EnsureStartsWith('~')) + ") !important;";
C:\ABP\LeptonX_422\src\Volo.Abp.AspNetCore.Mvc.UI.Theme.LeptonX\Themes\LeptonX\Layouts\Application\TopMenuLayout.cshtml 30,9: var logoUrl = BrandingProvider.LogoUrl == null ? null : "--lpx-logo: url(" + Url.Content(BrandingProvider.LogoUrl.EnsureStartsWith('/').EnsureStartsWith('~')) + ") !important;"; 30,36: var logoUrl = BrandingProvider.LogoUrl == null ? null : "--lpx-logo: url(" + Url.Content(BrandingProvider.LogoUrl.EnsureStartsWith('/').EnsureStartsWith('~')) + ") !important;"; 30,111: var logoUrl = BrandingProvider.LogoUrl == null ? null : "--lpx-logo: url(" + Url.Content(BrandingProvider.LogoUrl.EnsureStartsWith('/').EnsureStartsWith('~')) + ") !important;";
These all check the starting character of the string to ensure that it is locally hosted.
I know that I can overwrite these layouts in my own project and correct the issue to my own needs but I would prefer if this was a consistent implementation meaning that I can just update my ABP packages.
Thanks
5 Answer(s)
-
0
To address the inconsistency in handling external Logo URLs in LeptonX MVC layouts:
- The Empty layout in LeptonX allows external URLs for the logo by directly using the value from BrandingProvider.LogoUrl.
- Other layouts (SideMenuLayout, TopMenuLayout) force the logo URL to be a local path by applying EnsureStartsWith('/') and EnsureStartsWith('~'), and then passing it to Url.Content. This prevents the use of externally hosted images.
This is a known inconsistency. The recommended way to customize or fix this in your project is to override the relevant layout files, as you mentioned. However, for a consistent and maintainable solution that survives ABP package updates, it is best to request this as a feature or bug fix from the ABP team, so that all layouts handle external URLs in a unified way.
You can open an issue or feature request on the official ABP GitHub repository or contact support to suggest that all LeptonX layouts should consistently support external logo URLs via BrandingProvider.
Sources:
- https://abp.io/docs/latest/ui-themes/lepton-x/mvc
This response was generated by AI. If it didn’t solve your problem, feel free to post a new answer — our support team will jump in to help you soon.
-
0
I would like to recommend this as a bug fix please.
-
0
Thanks. I will check and fix it.
-
0
Thanks, did you manage to create a fix for it?
-
0
hi
This will be fixed in 4.2.4
Thanks.