Magnolia 5.4 reached end of life on November 15, 2018. This branch is no longer supported, see End-of-life policy.
A theme is a collection of resource files that gives a site its visual identity through the use of colors and typography. A theme consists of Cascading Style Sheets (CSS), Javascript files and an imaging configuration which tells the Imaging module what to do with images for a particular page or component.
...
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.
...
Magnolia 5.4.6+
See Using a site definition for an example with a YAML file based theme.
Themes are configured in the Themes tab of the Site app.
...
Three configuration nodes define the individual elements of a theme:
travel-demo-theme |
| Optional References CSS files. |
| Optional References JavaScript files. |
| Optional Defines image variations a.k.a renditions. |
Links to CSS resources are configured in the cssFiles
node of the theme.
...
Advanced Tables - Table Plus | ||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||||||||||||||||||||||||||||||||||||||
|
Properties:
cssFiles | optional CSS node of the theme. | |||||
| required Arbitrary node name. Add a node for each sheet. | |||||
| optional Embeds a file content fingerprint in the resource URL. The fingerprint consists of a timestamp in the | |||||
| required Path to the CSS file that is added to the HTML. See Adding style to HTML for more. See also Web resources and Origins and loading order for different options for storing and loading resources. | |||||
| optional Media associated with the linked CSS file. If you use a responsive web design framework like Bootstrap or Foundation set this property to | |||||
| optional Defines the conditional comment attribute for the linked CSS file. Conditional comments are used to overcome the limitations of legacy browsers such as Internet Explorer 9 and earlier. For example, the conditional comment "
|
This simple theme example uses only the default Bootstrap minimized CSS with no customizations.
...
Advanced Tables - Table Plus | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||||||||||
|
Properties:
jsFiles | optional JavaScript node of the theme. |
| required Arbitrary node name. Add a node for each JavaScript file. |
| optional Embeds a file content fingerprint in the resource URL. The fingerprint consists of a timestamp in the |
| required Path to the JavaScript file. See Web resources and Origins and loading order for different options for storing and loading resources. |
Here's an example JavaScript alert box using JQuery and the default Bootstrap minimized CSS.
...
Advanced Tables - Table Plus | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Properties:
imaging | optional Imaging node of the theme. | ||||||||
| required Image variations node. | ||||||||
| required The name of the variation, a.k.a the rendition name. The name is used to call the variation in template scripts. Add one node for every variation. | ||||||||
| required You can use one of the available classes or create a custom one. The available properties depend on the class used for the variation. Any custom class must implement
MTE module provides
| ||||||||
| Add properties that are supported by the class used. | ||||||||
| required
| ||||||||
| optional Enables and disables variation support. |
The SimpleResizeVariation
class is suitable for most resize variations. It resizes the original image to a defined size in pixels.
Properties:
<variation name> |
| required
|
| optional, default is Whether cropping is allowed. |
| optional An integer that defines the height in pixels. |
| optional An integer that defines the width in pixels. |
Behavior:
ImagingException
and the image displays in it's original uploaded size.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 | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| |||||||||||||||
|
Properties:
themes | required Theme node. |
| required The value of this property must match the name of the theme configured in |
...