Jump to content

multi css


JarekZ

Recommended Posts

  • 4 months later...

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?

Link to comment
Share on other sites

"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 !

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...