Skip to content
Daniel Metzner edited this page May 31, 2019 · 1 revision

Flavors are sub-sections (themes) of our website.

Examples would are "pocketcode "luna", or "pocketgalaxy. The default one if none is specified is "pocketcode"

Routing

All routes in our project are prefixed with a theme.

To allow a route like share.catrob.at/newThemeName, the new theme must be added to the themes array in config/packages/liip_theme.yaml first.

Theme Templates

Per default, if a flavored URL is accessed, a theme with the same name is loaded. In combination with twig, the actual theme can be checked

    {% if theme() == 'luna' %}

This allows us to easily add theme specific content.

Theme Style

For every theme, there must exist a settings file under the followingPath assets/css/themes/<theme_name>/_theme_settings.scss.
In this file one can overwrite variables for colors, sizes, etc.)

Since CSS files are generated by a grunt job we have to add the theme to the themes array in our Gruntfile.js

Admin

Flavors are stored as strings for simplicity. Keep in mind that select-boxes in SonataAdmin need to be changed separately. (if those fields are not text-fields)