Fresh Install - Invalid block tag: 'endfor', expected 'empty' or 'endthumbnail'

946 views
Skip to first unread message

mdp

unread,
Nov 27, 2010, 6:44:45 AM11/27/10
to Satchmo users
Hi,

I'm fairly comfortable with Django and Python but this is my first
delve into Satchmo, so apologies if I've missed something obvious.
I've just installed Satchmo following the instructions here - "http://
www.satchmoproject.com/docs/dev/quickstart.html" and I'm following the
tutorial here "http://www.satchmoproject.com/docs/dev/tutorial1.html".
Unfortunately, for every template I've so far accessed ie index.html
and product.html, I'm getting the following error:

Invalid block tag: 'endfor', expected 'empty' or 'endthumbnail'

where the block in question is something like:

{% 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 %}

Obviously I can fix this by adding an {% endthumbnail %} end tag after
the href, but before doing so I wanted to check the error wasn't a
result of not having set something up correctly.

Thanks

Chris Moffitt

unread,
Nov 27, 2010, 10:19:07 AM11/27/10
to satchm...@googlegroups.com
I haven't been actively following sorl development lately but it looks like they are pushing out a new version that has this new syntax.

I currently use version 3.2.5 and it still has the same syntax and should work unmodified.

Anyone have experience with the newer sorl code? Looks like we're going to have to figure out what we want to do on a go forward basis.

-Chris


--
You received this message because you are subscribed to the Google Groups "Satchmo users" group.
To post to this group, send email to satchm...@googlegroups.com.
To unsubscribe from this group, send email to satchmo-user...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/satchmo-users?hl=en.


Mike Peters

unread,
Nov 28, 2010, 9:05:12 AM11/28/10
to satchm...@googlegroups.com
On 27 November 2010 15:19, Chris Moffitt <ch...@moffitts.net> wrote:
I haven't been actively following sorl development lately but it looks like they are pushing out a new version that has this new syntax.

I currently use version 3.2.5 and it still has the same syntax and should work unmodified.

Anyone have experience with the newer sorl code? Looks like we're going to have to figure out what we want to do on a go forward basis.

-Chris
 

So it seems the current stock templates don't play nicely with the current version of sorl. I've created my own templates in which I've had to use the following syntax to get images to display:

eg I changed:

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

to:
               {% thumbnail product.main_image.picture "85x85" as image %}
              <a href="{{ product.get_absolute_url }}"><img src="{{ image.url }}" width="{{ image.width }}" height="{{ image.height }}" /></a>
               {% endthumbnail %}

Note the "'s around the image dimensions and the endthumbnail tag. I also had to change src="{{ image }}" to src="{{ image.url }}" as with just {{ image }} the url was for a non existent cache url, although I'm not sure that is down to some incorrect config on my part. If anyone has a better suggestion as how to do this then please let me know :-)

Thanks
(PS apologies if this comes through twice, I initially sent from a different email address to the one I subscribed with)

--
Mike
Web Site: http://www.ice2o.com
Photos: http://www.flickr.com/photos/mikedpeters/
Registered Linux User #247123

Chris Moffitt

unread,
Nov 28, 2010, 9:57:23 AM11/28/10
to satchm...@googlegroups.com
Another possible option is to force an old install of sorl. Try this:
pip install sorl-thumbnail==3.2.5

-Chris

--
Reply all
Reply to author
Forward
0 new messages