Selecting customizations and themes

When a GBC application displays, it displays using a specific customization and theme. In this topic, we explain what determines which customization and theme is chosen.

Which customization?

Read through the scenarios below to understand which customization is chosen. These customizations assume you have deployed your customizations to the Genero Application Server (GAS).

The default customization

If you have deployed your customizations to the Genero Application Server (GAS), you have the option to set one customization as the default. The application server uses the default customization when the application is served, unless a different customization is specifically requested for an application (as described below).

Tip:

It is recommended that you specify a customization to serve as the default customization.

Use the Deployment App to deploy a customization and specify a default.

Note:

If you are using a version of GAS that is earlier than 3.20, the Deployment App may not be available. For more details, see the Genero Application Server User Guide.

You can also use the gasadmin tool, or you can manually configure the _default file. To read about alternate methods, see Deploy on GAS or refer to the Genero Application Server User Guide.

Specify customization in the application configuration

You can specify a customization with the GBC element in the application configuration file. In this example, the "sample" customization is specified:

<?xml version="1.0" encoding="UTF-8" ?>
<APPLICATION Parent="defaultgwc" 
              xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
              xsi:noNamespaceSchemaLocation="https://4js.com/ns/gas/3.10/cfextwa.xsd">
 <EXECUTION>
  <PATH>$(res.deployment.path)</PATH>
  <MODULE></MODULE>
 </EXECUTION>
 <UA_OUTPUT>
  <GBC>sample</GBC>
  <PUBLIC_IMAGEPATH>$(res.public.resources)</PUBLIC_IMAGEPATH>
 </UA_OUTPUT>
</APPLICATION> 

Specify customization in the URL

You can specify a customization in the application URL by setting the gbc query string parameter. For example, open the demos application by entering the URL for your GAS in a browser:
GAS 5.00 and greater
http://localhost:6394/ua/r/demo?gbc=sample
GAS prior to 5.00
http://localhost:6394/ua/r/gwc-demo?gbc=sample

Which theme?

Read through the scenarios below to understand which theme is chosen.

By default, the first valid theme is used

The themes available are specified in the config.json file for the customization. The order in which the themes are listed in this file is important. Barring any other configuration, the first valid theme listed -- that means the first theme that is not excluded based on a condition such as isDesktop or isMobile -- is the theme that is used by default. For more information, see Theme conditions.

Your theme selection is remembered

The GBC remembers which theme the end user last selected for an application. If the end user switches themes while using an application, the system remembers which theme the end user last chose and uses that theme when the end user next accesses the application.

The application can specify the theme

The application programmer can write code that specifies which theme to use. For more information, see Theme front calls in the Genero Business Development Language User Guide.

Specify theme in the URL

You can specify a theme in the application URL by setting the theme query string parameter. For example, open the demos application by entering the URL for your GAS in a browser:
GAS 5.00 and greater
http://localhost:6394/ua/r/demo?gbc=sample&theme=highcontrast
GAS prior to 5.00
http://localhost:6394/ua/r/gwc-demo?gbc=sample&theme=highcontrast

Changing the theme

When an application is running, the end user can change the theme used by clicking the Settings icon in the chromebar and selecting from the themes listed in the Interface theme combobox. To learn more about the chromebar, see Application page for GBC.