Magnolia 6.0 reached end of life on June 26, 2019. This branch is no longer supported, see End-of-life policy.

Page tree
Skip to end of metadata
Go to start of metadata

This page explains how you can provide and use custom SVG icons for apps.

Introduction

Every Magnolia app has an icon assigned to it. The icon can be defined in the app descriptor with the icon property.

In Magnolia 6.0, an app icon must be a file in the SVG image format. Reusing an icon from the Magnolia icon font is no longer possible. An exception is the app-icon character used by Magnolia as the fallback icon.

Where the icon is displayed

It is displayed:

  • In the App launcher:
  • In the tab name of the first subapp:
     
  • In the Find Bar search result list, when the result type is an app:
     
    (warning) There is a bug showing the fallback icon in the result list instead of a custom icon.

Providing and referencing a custom icon

To use a custom icon for an app, you must:

  • Provide an SVG file in a Maven module which is included in your webapp bundle.
    The SVG file must be located in the $maven-module/src/main/resources/VAADIN/appicons folder.
  • Reference the icon in the app descriptor by setting the property icon. Its value must be the filename without the svg suffix.

Example

  1. In your Maven module, add the fast-vehicle-icon.svg file to the src/main/resources/VAADIN/appicons folder.

    my-foobar-module/
    ├── pom.xml
    └── src
        └── main
            └── resources
                └── VAADIN
                    └── appicons
                        └── fast-vehicle-icon.svg

    Make sure to add my-foobar-module to your webapp bundle.

  2. Reference the icon from the app descriptor of your custom app:

    /content-type-examples/apps/tourVehicles-app.yaml
    !with-type:tourVehicle
    icon: fast-vehicle-icon

Result

  

Reusing app icons from the UI framework

Instead of using a custom app icon, you can also reference and use app icons that are part of the UI Framework, see their names in the Magnolia app icons gallery.

Default and fallback icons

Default icon

If you do not specify the icon property in the app descriptor, the system uses the icon-app image as the default icon.

Fallback icon

If you reference an SVG image that does not exist, the system uses the icon-app character from the Magnolia icon font as the fallback icon.