Django CMS plugin implementing html5 responsive images
Project description
djangocms-responsive-image
==========================
This package provides a plugin for Django CMS 3 similar to
cmsplugin\_filer\_image, but in addition can deliver multiple sizes as a html5
srcset attribute for the img tag.
configuration
-------------
How the srcset is built is determined by the style choices attribute.
You can configure them via the `DJANGOCMS_RESPONSIVE_IMAGE_IMAGE_STYLE_CHOICES`
setting:
DJANGOCMS_RESPONSIVE_IMAGE_IMAGE_STYLE_CHOICES = {
'fullwidth': {
'name': _('full width'),
'srcset': ((960, 0), (640, 0), ),
'sizes': '(max-width: 800px) 640px',
'default_size': (960, 0)
}
}
`srcset` ist a tuple of (width, height) tuples which will be used to create
the `srcset` img attribute and also to render the thumbnails with
`easy_thumbnails`.
`sizes` is the value of the `sizes` img attribute, refer to your favorite html5
documentation for information on how to use it. You can also omit it if
unnecessary.
`default_size` will be used for the `src` attribute and the corresponding thumbnail as a fallback for browsers which don't support `srcset`.
==========================
This package provides a plugin for Django CMS 3 similar to
cmsplugin\_filer\_image, but in addition can deliver multiple sizes as a html5
srcset attribute for the img tag.
configuration
-------------
How the srcset is built is determined by the style choices attribute.
You can configure them via the `DJANGOCMS_RESPONSIVE_IMAGE_IMAGE_STYLE_CHOICES`
setting:
DJANGOCMS_RESPONSIVE_IMAGE_IMAGE_STYLE_CHOICES = {
'fullwidth': {
'name': _('full width'),
'srcset': ((960, 0), (640, 0), ),
'sizes': '(max-width: 800px) 640px',
'default_size': (960, 0)
}
}
`srcset` ist a tuple of (width, height) tuples which will be used to create
the `srcset` img attribute and also to render the thumbnails with
`easy_thumbnails`.
`sizes` is the value of the `sizes` img attribute, refer to your favorite html5
documentation for information on how to use it. You can also omit it if
unnecessary.
`default_size` will be used for the `src` attribute and the corresponding thumbnail as a fallback for browsers which don't support `srcset`.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file djangocms-responsive-image-0.0.11.tar.gz.
File metadata
- Download URL: djangocms-responsive-image-0.0.11.tar.gz
- Upload date:
- Size: 5.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0a344eb7cbf09b9925c4a380f01884f9434e9d3876592322a86425e8c7d2c67c
|
|
| MD5 |
bd5e3e94124fe8666a5d98975d6ad40d
|
|
| BLAKE2b-256 |
8a4e04b8198f94488fb79a8a118842a2b002ce3359accd661ef41668b36ef1e1
|