4
 Followers
37
 Likes

Switching Themes at Runtime

Frontend
On our radar
Like the title says. I think it would be great to be able to switch them at runtime.
We have some applications that the CSS depends on the user that is logged in. Now we use a trick to do it, but it would be great if the platform would support this natively.
Created on 27 May 2011
Comments (18)
Merged this idea with 'Allow web screens to switch to another Theme' (created on 16 Feb 2018 12:47:47 by Luis Soares)

Allow web screens to switch to a different Theme.



This comment was:
- originally posted on idea 'Allow web screens to switch to another Theme' (created on 16 Feb 2018 by Luis Soares)
- merged to idea 'Switching Themes at Runtime' on 26 Oct 2018 02:45:37 by Justin James

Hey Luis,

When do you need this? Do you usually have different screens with different themes inside a single ui flow?

You can already override the theme being used at flow level.

Cheers,



This comment was:
- originally posted on idea 'Allow web screens to switch to another Theme' (created on 16 Feb 2018 by Luis Soares)
- merged to idea 'Switching Themes at Runtime' on 26 Oct 2018 02:45:37 by Justin James

There was already two situations that we needed to use the same screen(s) with two or more different themes.

If it's just one screen we can use several webflows (each one with a different theme) and the pages presenting the same content (on webblocks) But in my opinion that doesn't seems a good solution.

According with some rules we may want to present the page to the user on a different theme (to make it more clear to the him where he is).

And yes we can override the theme at flow level but that's not easy to do in runtime, right? It's kinda static for all the screens inside the webflow. 

In case we have a flow with several screens and if we want to present all them in a different way how can we achieve that?





This comment was:
- originally posted on idea 'Allow web screens to switch to another Theme' (created on 16 Feb 2018 by Luis Soares)
- merged to idea 'Switching Themes at Runtime' on 26 Oct 2018 02:45:37 by Justin James

Hi Luis,

Oh you want to dynamically change the styles!

I wouldn't call it two *themes* and I wouldn't create two OutSystems themes to achieve that. What you can do is to have a single theme that styles elements based on css classes in an outer layout container (or even the html body). This way, you can simply write your css and prefix the styles of one specific theme with the css class you want. For example:

Now you just have to switch the css class of the layout element to "red" or "blue" to adapt your screen, and you only have to maintain one css.

Hope this helps ;)



This comment was:
- originally posted on idea 'Allow web screens to switch to another Theme' (created on 16 Feb 2018 by Luis Soares)
- merged to idea 'Switching Themes at Runtime' on 26 Oct 2018 02:45:37 by Justin James

Currently we have several themes. Each of theme applies different colors to all the elements of a page.

I want to switch between them dynamically.



This comment was:
- originally posted on idea 'Allow web screens to switch to another Theme' (created on 16 Feb 2018 by Luis Soares)
- merged to idea 'Switching Themes at Runtime' on 26 Oct 2018 02:45:37 by Justin James
Merged this idea with 'Switch Theme dynamically at the screen level' (created on 09 Oct 2017 13:16:39 by Gonçalo Martins)

It would be very useful if you could implement a feature to allow us to dynamically switch the Theme in use at the flow/screen level in run-time, according to a certain parameter.



This comment was:
- originally posted on idea 'Switch Theme dynamically at the screen level' (created on 09 Oct 2017 by Gonçalo Martins)
- merged to idea 'Switching Themes at Runtime' on 26 Oct 2018 02:46:27 by Justin James

As Front End Developer would love this feature, this would solve me a lot of problems.
Could reuse some common layouts with different themes would be fantastic specially in terms of CSS optimisation.



This comment was:
- originally posted on idea 'Switch Theme dynamically at the screen level' (created on 09 Oct 2017 by Gonçalo Martins)
- merged to idea 'Switching Themes at Runtime' on 26 Oct 2018 02:46:27 by Justin James

+1



This comment was:
- originally posted on idea 'Switch Theme dynamically at the screen level' (created on 09 Oct 2017 by Gonçalo Martins)
- merged to idea 'Switching Themes at Runtime' on 26 Oct 2018 02:46:27 by Justin James

As Front End Developer would love this feature, this would solve me a lot of problems.
Could reuse some common layouts with different themes would be fantastic specially in terms of CSS optimisation.



This comment was:
- originally posted on idea 'Switch Theme dynamically at the screen level' (created on 09 Oct 2017 by Gonçalo Martins)
- merged to idea 'Switching Themes at Runtime' on 26 Oct 2018 02:46:27 by Justin James

As Front End Developer would love this feature, this would solve me a lot of problems.
Could reuse some common layouts with different themes would be fantastic specially in terms of CSS optimisation.



This comment was:
- originally posted on idea 'Switch Theme dynamically at the screen level' (created on 09 Oct 2017 by Gonçalo Martins)
- merged to idea 'Switching Themes at Runtime' on 26 Oct 2018 02:46:27 by Justin James

+1



This comment was:
- originally posted on idea 'Switch Theme dynamically at the screen level' (created on 09 Oct 2017 by Gonçalo Martins)
- merged to idea 'Switching Themes at Runtime' on 26 Oct 2018 02:46:27 by Justin James

+1



This comment was:
- originally posted on idea 'Switch Theme dynamically at the screen level' (created on 09 Oct 2017 by Gonçalo Martins)
- merged to idea 'Switching Themes at Runtime' on 26 Oct 2018 02:46:27 by Justin James

As Front End Developer would love this feature, this would solve me a lot of problems.
Could reuse some common layouts with different themes would be fantastic specially in terms of CSS optimisation.



This comment was:
- originally posted on idea 'Switch Theme dynamically at the screen level' (created on 09 Oct 2017 by Gonçalo Martins)
- merged to idea 'Switching Themes at Runtime' on 26 Oct 2018 02:46:27 by Justin James

Err, the +1 is not very friendly, hence we have a simple like button.


Anyways,

how do you expect it to work?

you can do it easily by changing the url in the page as a workaround, but as you are proposing it as an idea, i want to know how you see it inside the design.





This comment was:
- originally posted on idea 'Switch Theme dynamically at the screen level' (created on 09 Oct 2017 by Gonçalo Martins)
- merged to idea 'Switching Themes at Runtime' on 26 Oct 2018 02:46:27 by Justin James

I would envision something similar to "SetCurrentLocale" and see the Themes enumerated like Roles, Resources, etc. so you can pass the right value along.

J.Ja



This comment was:
- originally posted on idea 'Switch Theme dynamically at the screen level' (created on 09 Oct 2017 by Gonçalo Martins)
- merged to idea 'Switching Themes at Runtime' on 26 Oct 2018 02:46:27 by Justin James

Also, have this problem in my current project.

Under the same group, we have 4 companies. And for each one, we have a different theme/branding. All applications are the same except for the services and the design of it.

For me, this information is always user related that's why it would be nice to be able to dynamically choose the theme when a user log-in.

views
1018
Followers
4