Sunday, November 10, 2013

Things to know about sorl-thumbnail

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

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAHSNPWsSXqLyTtT6bVoYYts_wLsKVFfxi6Y1yw-bu7v6sND%2B9A%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate