Permalink
Browse files

link to djangopackages instead of sorl

updated example to actually do what it says it does
fixed a typo
  • Loading branch information...
1 parent 108e2ea commit ee1dc44e452dd143ab02d8443cfcd54ca85decce Jonas Obrist committed Oct 17, 2011
Showing with 11 additions and 9 deletions.
  1. +11 −9 docs/getting_started/plugin_reference.rst
@@ -121,28 +121,27 @@ setting in your project's ``settings.py`` file::
# ...
)
-If you want to resize the picture you can get a thumbnail library. We
-recommend `sorl.thumbnail <http://thumbnail.sorl.net/>`_.
+There are several solutions for Python and Django out there to automatically
+resize your pictures, you can find some on `Django Packages`_ and compare them
+there.
In your project template directory create a folder called ``cms/plugins`` and
create a file called ``picture.html`` in there. Here is an example
-``picture.html`` template:
+``picture.html`` template using `easy-thumbnails`_:
.. code-block:: html+django
- {% load i18n thumbnail %}
- {% spaceless %}
+ {% load thumbnail %}
{% if picture.url %}<a href="{{ picture.url }}">{% endif %}
{% ifequal placeholder "content" %}
- <img src="{% thumbnail picture.image.name "484x1500" upscale as im %}{{ im.url }}{% endthumbnail %}" {% if picture.alt %}alt="{{ picture.alt }}" {% endif %}/>
+ <img src="{% thumbnail picture.image 300x600 %}"{% if picture.alt %} alt="{{ picture.alt }}"{% endif %} />
{% endifequal %}
{% ifequal placeholder "teaser" %}
- <img src="{% thumbnail picture.image.name "484x1500" upscale as im %}{{ im.url }}{% endthumbnail %}" {% if picture.alt %}alt="{{ picture.alt }}" {% endif %}/>
+ <img src="{% thumbnail picture.image 150x150 %}"{% if picture.alt %} alt="{{ picture.alt }}"{% endif %} />
{% endifequal %}
{% if picture.url %}</a>{% endif %}
- {% endspaceless %}
In this template the picture is scaled differently based on which placeholder
it was placed in.
@@ -156,7 +155,7 @@ running.
.. note:: For more advanced use cases where you would like to upload your media
to a central location, consider using `django-filer`_ with
- `django CMS plugin`_ and its ``cmsplugin_filer_video`` component
+ `django CMS plugin`_ and its ``cmsplugin_filer_image`` component
instead.
.. _django-filer: https://github.com/stefanfoulis/django-filer
@@ -355,3 +354,6 @@ For installation be sure you have the following in your project's
.. warning:: The inherit plugin is currently the only core-plugin which can
**not** be used in non-cms placeholders.
+
+.. _Django Packages: http://djangopackages.com/grids/g/thumbnails/
+.. _easy-thumbnails: https://github.com/SmileyChris/easy-thumbnails

0 comments on commit ee1dc44

Please sign in to comment.