Download the PHP package makinacorpus/drupal-iresponsive without Composer
On this page you can find all versions of the php package makinacorpus/drupal-iresponsive. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download makinacorpus/drupal-iresponsive
More information about makinacorpus/drupal-iresponsive
Files in makinacorpus/drupal-iresponsive
Package drupal-iresponsive
Short Description Image field formatter and theme functions for rendering responsive images using image styles
License GPL-2
Homepage http://github.com/makinacorpus/drupal-iresponsive
Informations about the package drupal-iresponsive
Responsive image formatter for Drupal
This module brings theme functions and a field formatter to display responsive images. It supports two different HTML tags:
- <IMG> tag using srcsrc attribute;
- <PICTURE> tag using <SOURCE> elements.
The <IMG> tag supports the sizes attribute allowing to set a relative viewport sizes for images at the field display configuration level, allowing the browser to proceed with better image selection for download.
This modules won't allow you to provide your own image styles, it only provides two different modes:
- Image keeps the original image ratio;
- Square image.
Future plans is to support more complex image styles (maybe by merging this module own styles using a user provided one).
This ships the Picturefill 2.0 polyfill to ensure graceful downgrade for old browsers.
Installation
Just download and enable the module.
Confguration
You may want to override available sizes for images, default is:
In order to override it, just add in your settings.php file:
Usage
For image fields
Select Responsive image as display formatter, quite straightforward ?
Displaying manually an image
Use one of or theme hooks and proceed this way with render arrays:
Or if you write Drupal 6 old school code (but you should never do this):