Reputation: 667
So I'm using the django-jcrop
plugin to crop an image. Inside my HTML file I have this line:
<img src="{% cropped_thumbnail order 'cropping' max_size='{{ ratio }}' %}">
When this is passed, I get the following error:
TemplateSyntaxError: max_size must match INTxINT
{{ ratio }}
is passed correctly outside of the tag, and gives the correct intended value, 400x400. When I remove the single quotes from the max_size='{{ ratio }}'
I then get the following error:
TemplateSyntaxError: Could not parse the remainder: '{{' from '{{'
So I am pretty sure ratio is not parsing correctly within the tag. Any ideas why?
Upvotes: 7
Views: 821
Reputation: 1110
inside a template tag you don't need to use the "{{}}", you can try the next code:
<img src="{% cropped_thumbnail order 'cropping' max_size=ratio %}">
Upvotes: 2