Base solution for your next web application
Open Closed

Custom MPA html design per Tenant #506


User avatar
0
byteplatz created

Hello

Is that possible to have custom layouts per tenant for the MPA Landing page ?

What approach would be ?

Bruno Bertechini


2 Answer(s)
  • User Avatar
    0
    hikalkan created
    Support Team

    Hi,

    Default design is not like that. But you can implement it for your application. Add layouts or views for your tenants (say _Layout_TenantName.cshtml) and select it by current tenant.

    There are some alternative ways. Most simple can be: Open the _ViewStart.cshtml (<a class="postlink" href="https://github.com/aspnetzero/aspnet-zero/blob/master/src/MyCompanyName.AbpZeroTemplate.Web/Views/_ViewStart.cshtml">https://github.com/aspnetzero/aspnet-ze ... art.cshtml</a>):

    @{
        Layout = "~/Views/Layout/_Layout.cshtml";
    }
    

    As you see, _Layout.cshtml is used for every tenant. Here, you can implement a logic like that;

    • Get current Tenant's name (probably from subdomain using ITenancyNameFinder - SubdomainTenancyNameFinder)
    • Check is there is a _Layout_TenantName.cshtml file for current tenant (surely you should create one before).
    • If there is, use it, if not use default _Layout.cshtml.
  • User Avatar
    0
    byteplatz created

    Great. I was going pretty much the same thought.

    I will try something like that in near future.

    Bruno Bertechini