How to organize themes

0
I have a Mendix application that uses 2 themes. The first theme is used when the application is accesed in a 'normal' way. The second theme is used on a page accesed by a deeplink. I created both themes and placed the 2 zip's in the <project>/theme folder. I thought I would be able to select the second theme in the deeplink page, but I think this is not possible? I use a different index page for the deeplink, so I could put both theme's in one zip and use that. Is that what I need to do? I would prefer to keep the 2 themes seperate so I can easily use it as theme's on different projects.  How does the https://ux.mendixcloud.com/theme-viewer.html switches themes? 
asked
3 answers
0

You have two options:

1) create a index4.html and refer to the seperate style sheets. In the deeplink config you set this index4 page as alternative index page.

2) You have an app in the store called stylesheetswitcher (https://appstore.home.mendix.com/link/app/3067/TimeSeries/StyleSheetSwitcher). The documentation is straight forward and you can then use a different custom.css.

Regards,

Ronald

answered
0

Hey Ronald,

I did found these 2 options, like I said in my post I am already using option 1 (seperate index page for deeplink). But is it possible to include 2 themes (so 2 zip files in the theme folder) and access the css from both styles in the index page? 

answered
0

Martijn, note that you do not need to use only zipped themes.  You can include any files you like in your theme folder and they will be copied to your deployment, so you can have multiple css files available.  In my own app, I use a request handler to select the correct one in my index.html file:

        <link rel="stylesheet" href="css/theme.css?{{cachebust}}">
	<link rel="stylesheet" href="cssfile/?{{cachebust}}">

theme.css is the styling common to all options, and the cssfile request handler returns the custom css file to use

This post might give you guidance on how to set up a suitable request handler: https://forum.mendix.com/link/questions/16422 or you could use the one from the app store

answered