Open Closed

Headers Missing on Login Pages when Only One Language Enabled #10432


User avatar
0
jackmcelhinney created

When only 1 language is enabled, the page titles on MVC login/reset password/etc do not show.

In the default layout code, the title is wrapped up with the check if there is more than 1 language:

@{                                
    var hasLanguageSwitch = languageInfo.Languages.Count > 1;
    ...                             
}

<div class="card mx-auto" style="max-width: 30rem;">
    <div class="card-body p-3 p-sm-4">
        @if (hasLanguageSwitch)
        {                                        
            <div class="align-items-start d-flex justify-content-between mb-2">                                            
                <h2 class="lpx-main-title lpx-login-title m-0 me-auto"> @PageLayout.Content.Title </h2>                                                     
                <div class="dropdown btn-group ms-auto" aria-labelledby="languageDropdown">
                    <button class="btn btn-sm btn-light dropdown-toggle" type="button" data-bs-toggle="dropdown" aria-expanded="false">                                                   
                        <i class="bi bi-translate me-1"></i> @languageInfo.CurrentLanguage.DisplayName
                    </button>
            ...
        }
    </div>
</div>

I've fixed this by overriding the layout, moving the @if block to not include the page title, but I would prefer this be fixed in the source so I don't need to override if not necessary. Fix:

@{                                
    var hasLanguageSwitch = languageInfo.Languages.Count > 1;
    ...                             
}

<div class="card mx-auto" style="max-width: 30rem;">
    <div class="card-body p-3 p-sm-4">
                                               
        <div class="align-items-start d-flex justify-content-between mb-2">                                            
            <h2 class="lpx-main-title lpx-login-title m-0 me-auto"> @PageLayout.Content.Title </h2>                                                     

            @if (hasLanguageSwitch)
            { 
                <div class="dropdown btn-group ms-auto" aria-labelledby="languageDropdown">
                    <button class="btn btn-sm btn-light dropdown-toggle" type="button" data-bs-toggle="dropdown" aria-expanded="false">                                                   
                        <i class="bi bi-translate me-1"></i> @languageInfo.CurrentLanguage.DisplayName
                    </button>
                ...
            }
        </div>
    </div>
</div>


2 Answer(s)
  • User Avatar
    0
    AI-Bot created
    Support Team ABP Agent
    • This is a theme layout bug in the MVC Account layout of LeptonX (your screenshots match it). In ABP v10.0.2, the layout renders the login “header row” (including @PageLayout.Content.Title) only when the language switch is shown (i.e., when languageInfo.Languages.Count > 1). So, with a single enabled language, the title disappears exactly as you observed.
    • Your fix is correct: render the title unconditionally and only conditionally render the language dropdown.

    What you should do (until it’s fixed upstream)

    1. Override the LeptonX account layout in your host project:
      • Create: Themes/LeptonX/Layouts/Account/Default.cshtml
      • Copy the original layout content into it (from the theme package source) and apply your change: move @PageLayout.Content.Title out of the if (hasLanguageSwitch) block.
    2. Keep the conditional only around the dropdown.

    This is the intended/standard way to patch theme layout issues without modifying NuGet package files directly.

    • https://abp.io/docs/latest/framework/ui/mvc-razor-pages/basic-theme (reachable)
    • https://abp.io/docs/latest/ui/aspnetcore/customization-user-interface#overriding-a-razor-page-cshtml (reachable)

    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.

  • User Avatar
    1
    maliming created
    Support Team Fullstack Developer

    hi

    Thanks. We will fix it in the next version.

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.2.0-preview. Updated on February 17, 2026, 09:10
1
ABP Assistant
🔐 You need to be logged in to use the chatbot. Please log in first.