Galaxies templates when using Photon templates

Note: Use of the Photon template library is a pre-requisite to being able to create Galaxies site themes in this way.

Adding a custom theme

  1. Create a Photon project Symfony bundle (documented in our Photon documentation)
  2. The configuration of the theme is specified in the file Resources/config/theme.yml. The configuration of the theme specifies values such as its name, author, etc. The settings defined in the configuration file determine what controls a content author has access to when creating a site with this theme.
  3. Add your theme repository as a dependency of your site project in composer.json and apply to your site.
  4. Once the theme files are on the CMS server, run the theme register command.

php cli.php cms:theme-register path/to/theme

Example theme.yml file

name: Dopetrope
author: Jadu Ltd 
description: Adapted from Dopetrope by HTML5 UP.
screenshot: images/preview.png
credits: 
  html5up.net | @ajlkn
machine-name: jadu-dopetrope
bundle-class-name: Photon\Themes\DopetropeTheme\DopetropeThemeBundle
tags: html5, responsive
Option Description Required?
name The name of the theme yes
author The developer or organisation that created the theme no
description A textual description of the theme. Note - this isn't shown within the Control Center interface no
screenshot File path of the preview of the theme bundle yes
settings Customisable settings of the theme, that define how an author can change the display of the site. no
credits Other deverlopers or organisations that have produced assets used within the theme no
machine-name A machine name for the theme. It should start with a letter, and can contain alphanumeric characters and hyphens yes
bundle-class-name PSR namespace of the bundle class of the theme yes
tags A comma separated list of tags, that are used to classify the theme within the theme selection window no

Theme settings

Each theme can have multiple settings which are defined in the settings tag within theme.yml.

The supported field types are:

  • text
  • select
  • file
  • textarea
  • image
  • radio
  • toggle

Text

Attributes Description Mandatory
label The label to be displayed next to the field yes
required Whether the field is required no
default-value The default value of the field no
notes Help text provided for the field no

Select

Attributes Description Mandatory
label The label to be displayed next to the field yes
required Whether the field is required no
options An array of options, each with a label and value yes
notes Help text provided for the field no

Options should be provided in the following format:

Example:

    options:
        blue:
            label: Education (Blue)
            value: school-blue
        green:
            label: Education (Green)
            value: school-green

File

Attributes Description Mandatory
label The label to be displayed next to the field yes
required Whether the field is required no
notes Help text provided for the field no

Textarea

Attributes Description Mandatory
label The label to be displayed next to the field yes
required Whether the field is required no
notes Help text provided for the field no

Image

Attributes Description Mandatory
label The label to be displayed next to the field yes
required Whether the field is required no
notes Help text provided for the field no

Radio

Attributes Description Mandatory
label The label to be displayed next to the field yes
options An array of options, each with a label and value yes
notes Help text provided for the field no
default-value The default value of the field no

Options should be provided in the following format:

Example:

    options:
        blue:
            label: Education (Blue)
            value: school-blue
        green:
            label: Education (Green)
            value: school-green

Toggle

Attributes Description Mandatory
label The label to be displayed next to the field yes
notes Help text provided for the field no
default-value The default value of the field no

Managing Galaxies site themes

Removing a theme

If you wish to remove one of your registered themes from the CMS, the following command is provided.

php cli.php cms:theme-remove NAME

NAME is the attribute of the name value in the theme.yml configuration file.

Note: You will be prompted to confirm if the theme you are attempting to remove is currently assigned to one of your Galaxies sites. We recommend that you only remove themes that are not currently in use.

Theme clean up

php cli.php cms:theme-cleanup

Running this command will identify and list any broken themes that are registered on your server, along with their status of whether they are assigned to any Galaxies sites.

After running the command you will be prompted to confirm clean up actions after the list is shown.

results matching ""

    No results matching ""