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?
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 %}">
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With