...
Theme resources can be stored in light (YAML) or Maven modules. Themes can reside in a dedicated theme module or form part of another module. A special module version handler is not necessary.
...
- Theme resources are applied to the entire site.
- Resources are all in one place.
- Themes are an easy way to work with resources without having to modify the head section of your HTML
- You can define more than one theme and switch between them, or apply a different theme to a variation of your site. For example, you could use a different theme for pages targeted at U.S. users and European users, or a seasonal theme for different times of the year.
- You can still use different or additional overriding resources on a page-template level.
Configuring a theme with YAML
Magnolia 5.4.6+
See Using a site definition for an example with a YAML file based theme.
Configuring a theme with JCR
Themes are configured in the Themes tab of the Site app.
...
Three configuration nodes define the individual elements of a theme:
...
Advanced Tables - Table Plus |
---|
heading | 0 |
---|
multiple | false |
---|
enableHeadingAttributes | false |
---|
enableSorting | false |
---|
class | m5-configuration-tree |
---|
enableHighlighting | false |
---|
|
|
...
Advanced Tables - Table Plus |
---|
heading | 0 |
---|
multiple | false |
---|
enableHeadingAttributes | false |
---|
enableSorting | false |
---|
class | m5-configuration-tree |
---|
enableHighlighting | false |
---|
|
Node name | Value |
---|
| |
| | |
| | |
| | true | | /.resources/travel-demo-theme/js/modernizr-2.6.2.min.js |
|
...
Advanced Tables - Table Plus |
---|
heading | 0 |
---|
multiple | false |
---|
enableHeadingAttributes | false |
---|
enableSorting | false |
---|
class | m5-configuration-tree |
---|
enableHighlighting | false |
---|
|
Node name | Value |
---|
| |
| | |
| | |
| |
| | info.magnolia.templating.imaging.variation.SimpleResizeVariation | | 1600 | |
| | |
| |
| |
| | info.magnolia.templating.imaging.variation.SimpleResizeVariation | | 1200 | | 1600 | |
| | |
| | |
| | info.magnolia.templating.imaging.VariationAwareImagingSupport |
|
...
Properties:
<variation name> | |
|
class
| required SimpleResizeVariation resizes images to a defined size.
|
crop
| optional, default is true Whether cropping is allowed. |
height
| optional An integer that defines the height in pixels. |
width
| optional An integer that defines the width in pixels. |
...
- Although both the width and height properties are optional you must configure at least one. If you omit both the renderer intentionally throws an internal
ImagingException
and the image displays in it's original uploaded size. - If you define both width and height the image is sized down to the lower of the two and the rest is cropped, if necessary. Cropping starts from the middle, so the image is either cropped on top and bottom, or left and right.
- If you define only width or height, the omitted property is calculated using the aspect ratio of the original image.
- if you set crop to
false
, the image is resized to the specified size, and may be distorted (stretched).
See damfn and Working How to work with images using damfn for how to use variations in your scripts.
...
Advanced Tables - Table Plus |
---|
heading | 0 |
---|
multiple | false |
---|
enableHeadingAttributes | false |
---|
enableSorting | false |
---|
class | m5-configuration-tree |
---|
enableHighlighting | false |
---|
|
Node name | Value |
---|
|
| | |
| | travel-demo-theme | |
|
|
Properties:
themes | required Theme node. |
name
| required The value of this property must match the name of the theme configured in /modules/site/config/themes . |
...