divio/django-cms — Issue #1108: Error in documentation for Picture plugin
Author: benjaoming
Created: 2011-12-07 13:30:08+00:00
State: open

The example template code does[1] not work because sorl.thumbnail template tag is not invoked that way. Please consider replacing with the below code. It is more useful as it will provide a link to a full-size image and has an else-clause in the if placeholder==XX (which replaces the deprecated ifequal block).

{% load thumbnail %}
{% spaceless %}

{% if picture.url %}{% else %}{% endif %}
{% if placeholder == "right column" %}
{% thumbnail picture.image "300x300" as im %}

{% endthumbnail %}
{% else%}
{% thumbnail picture.image "600x600" as im %}

{% endthumbnail %}
{% endif %}

{% endspaceless %}

[1] http://readthedocs.org/docs/django-cms/en/latest/getting_started/plugin_reference.html#picture