DAM JCR Fastly renderer module
Edition |
Incubator (services) |
||
Issues |
|||
Git |
|||
Latest |
1.0.7
|
The DAM JCR Fastly renderer module provides an extension to the DAM JCR connector, adding the option to use renditions generated by the Fastly Image Optimizer instead of using the renditions generated by Magnolia.
This module is at the INCUBATOR level. |
Installing with Maven
Maven is the easiest way to install the module. Add the following to your bundle:
<dependency>
<groupId>info.magnolia.dam</groupId>
<artifactId>magnolia-dam-jcr-fastly</artifactId>
<version>1.0.7</version>
</dependency>
Configuration
Renditions are configured in the config.yaml
file of the module. You can decorate it using a custom light module or use the Resources App to add more renditions. The renderer generates a link to the dam servlet adding in the query string parameters configured for the rendition.
For more on asset renditions in Magnolia, see the DAM API’s AssetRenditions and MediaTypes. |
renditions:
width-960: width=960&crop=16:9,smart (1)
thumbnail: crop:1:1,smart&width=64 (2)
1 | The link generated for the width-960 rendition would be /dam/jcr:78399215-aed5-4518-9cfc-9b39855f4740/ash-edmonds-441220-unsplash.jpg?width=960&crop=16:9,smart . |
2 | The link generated for the thumbnail rendition would be /dam/jcr:78399215-aed5-4518-9cfc-9b39855f4740/ash-edmonds-441220-unsplash.jpg?crop:1:1,smart&width=64 . |
Dynamic renditions
The module support dynamic renditions that does not need to be predefined. So if you try to obtain the following rendition 400x200, it will generate a link using the parameters width=400&height=200.
The following related parameters can be configured too:
enableDynamicRenditions: true (1)
extraDynamicRendition: crop:1:1,smart (2)
1 | Setting enableDynamicRenditions to false will disable dynamic renditions. |
2 | In extraDynamicRendition , you can include any parameter that will be always used for generating dynamic renditions. For instance, having the above configuration, the rendition 400x200 will generate this link: width=400&height=200&crop:1:1,smart . |