Logged on user theme

0
Is it possible to dynamically switch the theme based upon the logged on user?  I have a requirement for each logged on user to have their company specific theme.
asked
3 answers
3

Tom,

There is also a widget in the appstore just for this use case:  https://appstore.home.mendix.com/link/app/51520/

Hope that helps,

Mike

answered
3

Our front-end dev came up with a solution to a similar requirement, using the Set Attribute widget

https://appstore.home.mendix.com/link/app/5958/

You can target where you want to apply a class, use a microflow to determine a class attribute based on the user’s company name, and drop the AppStore widget into your pages.

This wouldn’t allow for total theme overhauls (layouts etc) but would let you control different stylesheets being represented.

answered
1

There are various ways of doing this.

You can set up something style 1-1 company and stored css in a field, then use some JS in an HTML snippet to load it, or can use a request handler, or a paramterised PRS serving up the CSS with a parameter of the company name

And as in the above you can write a widget or just use an HTML snippet with context to place a class on the <body> and then have your main CSS have those selectors set up for custom styling per that class placed on body.  The class is read from some context object table’s field

answered