matthewwithanm / django-imagekit

Automated image processing for Django. Currently v4.0
http://django-imagekit.rtfd.org/
BSD 3-Clause "New" or "Revised" License
2.26k stars 276 forks source link

variable alt attribute for thumbnail #508

Open TobitRE opened 3 years ago

TobitRE commented 3 years ago

Hi,

how can I use a variable inside the thumbnail template tag? I am following the tutorial:

{% load imagekit %}
{% generateimage 'myapp:thumbnail' source=source_file -- alt="A picture of Me" id="mypicture" %}

this works fine but now I want to fill the alt attribute with a variable.

I try it with a {% with %} condition and without. Nothing works. The image tag include the variable name without replacing it by the value.

thanks for helping.

best regards