Things to know about sorl-thumbnail

24 views
Skip to first unread message

Aamu Padi

unread,
Nov 11, 2013, 2:34:27 AM11/11/13
to django...@googlegroups.com

I am using sorl-thumbnail to create thumbnails for my project. I am implementing it only in templates and not in the models or the view. And each of the thumbnail are linked with their original image, which are used by a lightbox. As a newbie, I wanted to know, some of its functionality:

  1. Whether implementing it only in the template is the same, as using it in the models or the view and creating a new thumbnail for each one?
  2. How to configure different thumbnails for different image, as it can be done in easy_thumbnail?
  3. How to override the default values, eg: override the value of Quality, etc.

And lastly, is it a correct way of implementing it? Any advice or suggestion will be much appreciated. Thank you.

html:

{% for photo in photos %}
<div class="thumbnail_container">
<a href="{{MEDIA_URL}}{{photo.image}}" class="gallery" title="{{photo.title}}">
{% thumbnail photo.image "200x200" as im %}
<img src="{{ im.url }}" width="{{ im.width }}" height="{{ im.height }}" class="thumbnail">
{% endthumbnail %}
</a>
</div>
{% endfor %}
Reply all
Reply to author
Forward
0 new messages