Satchmo Error - Invalid block tag: 'thumbnail', expected 'else' or 'endif'

436 views
Skip to first unread message

Bobby Roberts

unread,
Feb 22, 2011, 1:22:16 PM2/22/11
to Django users
Hi group. I've posted this in the satchmo group but am posting here
as well in hopes of getting some help.

This error is caused by this code:

{% if product.main_image %}
<center>
{% thumbnail product.main_image.picture 85x85 as image
%}
<a href="{{ product.get_absolute_url }}"><img
src="{{ image }}" width="{{ image.width }}"
height="{{ image.height }}" /></a>
</center>
{% endif %}



it makes use of sorl thumbnail to resize images on the fly i believe.
We can import sorl thumbnail into python from command line just fine.

If anyone uses satchmo for their ecommerce store have you run into
this error? How did you resolve. Please help and thank you in
advance.

Bobby Roberts

unread,
Feb 22, 2011, 1:11:18 PM2/22/11
to Django users

Daniel Roseman

unread,
Feb 22, 2011, 4:25:35 PM2/22/11
to django...@googlegroups.com
You haven't loaded the template tag library that defines the thumbnail tag.

    {% load thumbnail_tags %}

or whatever.
--
DR. 

Bobby Roberts

unread,
Feb 22, 2011, 4:33:58 PM2/22/11
to Django users

hey daniel -

we've got {%load thumbnail%} at the top of the standard satchmo
template.

Bobby Roberts

unread,
Feb 22, 2011, 5:02:06 PM2/22/11
to Django users
Hey Daniel -

we've got {% load thumbnail%} at the top of the template (a standard
satchmo template anyway)... running version 3.2.5 for sorl.




On Feb 22, 4:25 pm, Daniel Roseman <dan...@roseman.org.uk> wrote:

Bobby Roberts

unread,
Feb 25, 2011, 5:43:30 PM2/25/11
to Django users
anyone have any other ideas?

anvydigital

unread,
Mar 8, 2011, 5:05:41 PM3/8/11
to Django users
I ran into this issue also with the latest version of satchmo and sorl-
thumbnail. According to the sorl-thumbnail documentation, the tag
needs to be closed like so:

{% thumbnail item.image "100x100" crop="center" as im %}
<img src="{{ im.url }}" width="{{ im.width }}"
height="{{ im.height }}">
{% endthumbnail %}

It is quite likely you are (as am I) using code that expects an older
version of sorl-thumbnail.
http://thumbnail.sorl.net/examples.html

Options are possibly: use an older version of sorl-thumbnail, or
update templates.

pols

unread,
Mar 10, 2011, 4:32:05 AM3/10/11
to Django users
Check in settings.py installed apps for the entry
'satchmo_utils.thumbnail', If not istalled add this.If you are using
new version you may need to add {% endthumbnail %} in the templates
before closing endif

chris hendrix

unread,
Mar 10, 2011, 6:42:07 AM3/10/11
to django...@googlegroups.com
both of these are done and we're still getting the error.

pols

unread,
Mar 10, 2011, 8:00:00 AM3/10/11
to Django users
try re-installing thumbnail
easy_install sorl-thumbnail==3.2.5

chris hendrix

unread,
Mar 10, 2011, 8:11:53 AM3/10/11
to django...@googlegroups.com
yeah we've followed all the instructions


On 03/10/2011 08:00 AM, pols wrote:
> try re-installing thumbnail
> easy_install sorl-thumbnail==3.2.5
>

Reply all
Reply to author
Forward
0 new messages