"Themes" questions

640
4
11-16-2016 11:26 AM
PremRadhakrishnan
New Contributor III

In the documentation of themes, it says "One app can include more than one theme, but it can only use one theme while running." . Theme—Web AppBuilder for ArcGIS | ArcGIS 

1. How do you configure the same app to run with multiple themes with a theme switcher ?

2. When I actually switch themes in WAB I seem to lose all the widget configurations that was previously setup . For example if I had setup 10 layers in the Search widget it just defaults back to Geocoder. 

 

 

What I would like to do is create the same app with the same configuration but for multiple themes. 

Thanks in Advance. 

Tags (2)
0 Kudos
4 Replies
DerekLaw
Community Moderator

Hi Prem,

I think you've mis-interpreted the sentence in the help topic. The intent of the statement is to say you can create an app in Web AppBuilder and use any of the theme options for the app. When you deploy the app, you can only use one theme. But at any time, you can edit/change the theme if you want. We could probably rewrite the statement to be more clear.

We don't support the ability to have a "theme switcher" in a deployed app. In your case, you could create an app with theme 1. Then make a copy of the app and apply theme 2 for it, etc. In this way, you can have the same app with different themes applied (each different app is saved as its own item), however - not all themes are the same. For example, some themes support a logo, while others do not.

Hope this helps,

PremRadhakrishnan
New Contributor III

Thank you for your response. 

The issue that I am having is that if I configure widgets such as the search widget and coordinate widget in WAB  and then save it and at a later time switch the theme, none of the widget configurations persists and it defaults back to the original starting configuration. 

This seems counter productive having to reconfigure all the widgets just to change the theme. 

Any help is appreciated. 

DerekLaw
Community Moderator

Hi Prem,

I believe if you configure widgets placed in the HeaderController widget, then switch themes, their configurations will not change. For other widgets that form part of the web app UI, they may change when you switch themes.

Hope this helps,

0 Kudos
PremRadhakrishnan
New Contributor III

Hi Derek, 

That seems like it would be good for people who wanted widgets in the Header Controller but its not something that you can move around i.e. you cant simply move a widget from the header to another location, at least I could not figure out how to do that . 

I found a decent workaround after messing with things for a while. Here is what you can do to get your widgets configured back to their original state after changing the theme. I do believe that this is a shortcoming in WAB and should be addressed in a future release because the structure is there and the files are there, theres no reason for the widget configs to persist across theme changes but in the mean time here is what you can do. 

1. Save the application with theme A and download it 

2. Duplicate the application and apply theme B and then download it

3. Unzip both themeA application and theme B application 

4. Open an editor and copy the files from [root]\config\[widgetnames]\*.json from theme A to theme B

5. If you want to configure anything else in theme B using WAB , zip the files and import it back into WAB and wallah you have your widget configurations across themes. 

0 Kudos