Find the Exponential Software extensions you want
UNIX name | Owner | Status |
---|---|---|
ngresponsiveimages | Brookins Consulting | stable |
Version | Compatible with |
---|---|
N/A | N/A |
This extension uses picturefill.js v1.2.0 as a base for loading different image sizes.
# ngresponsive.ini
AlwaysResponsive=disabled
# full/article.tpl
...
{attribute_view_gui attribute=$node.data_map.image responsive_image_class=imagefull}
...
This use case requires that we change the template files and setup ngresponsiveimages.ini and image.ini file.
# ngresponsive.ini
AlwaysResponsive=enabled
# full/article.tpl
...
{attribute_view_gui attribute=$node.data_map.image image_class=imagefull [responsive_disabled]}
...
This case allows you to override image aliases without need to change the template files. Everything you need to do is to setup ngresponsiveimages.ini and image.ini file to your needs.
In ngresponsiveimages.ini, you need to define the responsive breakpoints with media query expressions.
[Responsive]
MediaQueryExpressions[]
MediaQueryExpressions[desktop]=(min-width: 768)
After that you need to create the group in ngresponsiveimages.ini file for each image alias in your eZ Publish installation that you would like to make responsive.
In the following example, imagefull image alias will be replaced with alias_768_3_2 on the desktop screen and for the mobile screen default_alias will be used because we didn't specified mapping for mobile screen MediaQueryMappings[mobile]:
[Responsive]
MediaQueryExpressions[]
MediaQueryExpressions[mobile]=(min-width: 480px)
MediaQueryExpressions[desktop]=(min-width: 768)
[imagefull]
DefaultMap=default_alias
MediaQueryMappings[]
MediaQueryMappings[desktop]=alias_768_3_2
This will output next html for imagefull alias:
Netgen & Mario Ivančić