Skip to main content
Warning: You are using the test version of PyPI. This is a pre-production deployment of Warehouse. Changes made here affect the production instance of TestPyPI (testpypi.python.org).
Help us improve Python packaging - Donate today!

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`.

By default, the srcset includes high-resolution (2x) images if the source image is large enough. You can disable
this behaviour by setting `DJANGOCMS_RESPONSIVE_IMAGE_ADD_2X = False`. If you are using custom templates older than
v0.1.1, you might update them to support 2x (see `templates/djangocms_responsive_image/default.html` for an example).

changelog
---------
0.1.1 added support for high-res images; bugfix
0.1.0 added description field and alt getter with fallback to the default\_alt\_text of the image
0.0.11 added fallback src attribute to default template

Release History

This version
History Node

0.1.1

History Node

0.1.0

History Node

0.0.11

History Node

0.0.6

History Node

0.0.5

History Node

0.0.4

History Node

0.0.3

History Node

0.0.1

Download Files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

File Name & Hash SHA256 Hash Help Version File Type Upload Date
djangocms-responsive-image-0.1.1.tar.gz
(5.4 kB) Copy SHA256 Hash SHA256
Source Jun 13, 2017

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting