Change the favicon

This procedure shows you how to change the favicon image.

Overview

A favicon is an icon associated with a URL that is variously displayed, as in a browser's address bar or tab, or next to the site name in a bookmark list. Figure 1 shows the tab of the OfficeStore demo displayed in the GBC client using the default favicon.

The default favicon

Figure 1: The default favicon

The image file for the favicon is named gbc_logo.ico. It is referenced in gbc-project-dir/src/index.html. This page is not customizable; to replace the default favicon, you add your own image using the same name (gbc_logo.ico). The only decision you make is in which directory you save your image; this decision affects when your custom image is used. You can make your image the default for all themes in a customization, or you can add it to a theme part in order to associate it with specific themes only.

Before you begin

This procedure assumes you are comfortable updating theme parts and themes. For the basic principles behind themes and theme parts, see How customization works. For instructions about adding and modifying themes and theme parts, see Manage themes.

Change the favicon for a customization

When using this method, all themes in the customization will use this image, unless the chosen theme overrides with its own favicon.

Save your image:

  • with the name "gbc_logo.ico".
  • in the gbc-project-dir/customization/customization-project-dir/resources/img directory.

Change the favicon using a theme part

When using this method, the favicon will be used for those themes that include the theme part.

  1. Identify the theme part you plan to update. If you are creating a new theme part, prepare the directory.
  2. Save your image:
    • with the name "gbc_logo.ico".
    • in the gbc-project-dir/theme/theme-directory/resources/img directory.
  3. If you created a new theme part, add it to one or more themes.

Compile

After adding your new version of the gbc_logo.ico to the desired directory and (if using theme parts) ensuring the theme part is assigned to one or more themes, you compile your customization.

$ gbc build --customization customization-project-dir

Test

Test that your changes work as expected. Close and reopen your application. Check whether the favicon displays as expected.

TIP: You may need to use CTRL + F5 to clear the browser cache before you see your changes.

If your tests do not behave as expected, ensure you are using your newly-compiled custom GBC. Depending on your development environment, you may need to package and deploy a custom GBC client. For information on which customization and theme you are using, see Selecting customizations and themes.