JarekZ Posted April 27, 2020 Posted April 27, 2020 Hello I am writing an application for several companies. Loads css files in servermodule (as customfiles) The problem is that each of the companies wants to have slightly different colors etc. How to do it best ?? Quote
Sherzod Posted April 27, 2020 Posted April 27, 2020 20 minutes ago, JarekZ said: The problem is that each of the companies wants to have slightly different colors etc. Hello, Also you can use UniMainModule OnCreate event for this. Quote
JarekZ Posted April 27, 2020 Author Posted April 27, 2020 in the mainmodule I choose a company. Then I create a form. When creating the form, I wanted to load css. OnCreateform does not work Quote
Sherzod Posted April 27, 2020 Posted April 27, 2020 3 minutes ago, JarekZ said: in the mainmodule I choose a company. What if after?.. Quote
JarekZ Posted April 27, 2020 Author Posted April 27, 2020 sorry, I chooce company in main. Then I create new form. Quote
mos Posted September 2, 2020 Posted September 2, 2020 I need do be able to do something similar. In the URL that launches the web app will be an identifier to indicate what company a user belongs to, and based on this I need to be able to load in a CSS file which contains their settings so it can be applied to the main form. How can I achieve this? Quote
irigsoft Posted September 3, 2020 Posted September 3, 2020 "In the URL that launches the web app will be an identifier to indicate what company a user belongs to" - this is it. on uniMainModule.onCreate check URL params and load correct CSS. like that: onMainModule.OnCreate (Sender: TObject); IF TUniGUISession(UniSession).UniApplication.Parameters.Values ['CompanyId'] = 'XX' then begin If FileExists (ExtractFileDir (Application.ExeName) + '\files\customCSS_CompanyID.css') then UniServerModule.CustomCSS.LoadFromFile (ExtractFileDir (Application.ExeName) + '\files\customCSS_CompanyID.css'); end; Works ! Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.