Hello
Is that possible to have custom layouts per tenant for the MPA Landing page ?
What approach would be ?
Bruno Bertechini
2 Answer(s)
-
0
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.
-
0
Great. I was going pretty much the same thought.
I will try something like that in near future.
Bruno Bertechini