Jump to content

Recommended Posts

Posted

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 ??

Posted
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.

Posted

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

  • 4 months later...
Posted

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?

Posted

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

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...