Closed postonoh closed 6 years ago
A little more info would help, but try to take a look at how it is implemented on the User table in the demo...
I have multiple clients my logo will all ways be the default logo on the sign on page . A couple of my clients would like to see their logo to display once the logged in to application. In the left corner and in favicon.
I have the following setup to work multi-tenant. I can sign on and each logo image upload to that company. That's working I need to modify the _Layout page pull from the database base on tenant id and user.
@postonoh, do share the code when a solution is found. I have been thinking through this logo thing for different tenants to no avail.
gfo2007 I am working let you know by the end of the week. I believe I should have it complete.
Her my solutions: I first created logo column on my clients Tables Then I added the following to _Layout.cshtml page
`@{ Func<string, IHtmlString> json = x => new HtmlString(Serenity.JSON.Stringify(x)); var hideNav = Request["hideNav"] == "1"; var logged = Serenity.Authorization.Username; var themeCookie = Request.Cookies["ThemePreference"]; var theme = themeCookie != null && !themeCookie.Value.IsEmptyOrNull() ? themeCookie.Value : "blue"; var rtl = System.Globalization.CultureInfo.CurrentUICulture.TextInfo.IsRightToLeft; var user = (UserDefinition)Serenity.Authorization.UserDefinition; var logo = ""; var clientlogo = LogoRetrievesServices.RetrieveClientLogo(logo);
var userImage = (user == null || string.IsNullOrEmpty(user.UserImage)) ? "whatever is you default userimage"
VirtualPathUtility.ToAbsolute("~/upload/") + user.UserImage;
var logoImage = (clientlogo == null || string.IsNullOrEmpty(clientlogo )) ? "whatever is you default logo" :
VirtualPathUtility.ToAbsolute("~/upload/") + clientlogo ;
}
}
Trying setup dynamic logos'
I created a logo table, columns are ID, LogoImage, TenantId
I can get the logo to upload, now I need to replace the logo and the favicon.
I tried duplicate some of the code on the _Layout.cshtml page