How about getting the path to the flags, then tacking on the filename
outside the tag...

{% static "assets/flags/" %}{{ request.LANGUAGE_CODE }}.gif

_Nik

On 5/20/2013 12:13 PM, Oscar Carballal wrote:
> Hi,
>
> I'm migrating to the new static tag in my project, and I ran into a
> problem, in some places I use variables to get the content, but that
> doesn't work anymore in django 1.5, is there any way to solve this?
>
> Current code:
> <img src="{{ STATIC_URL }}/assets/flags/{{ request.LANGUAGE_CODE
> }}.gif" alt="{% trans 'Language' %}" title="{% trans 'Language' %}" />
>
> What it should be (doesn't work):
> <img src="{% static 'assets/flags/{{ request.LANGUAGE_CODE }}.gif' %}"
> alt="{% trans 'Language' %}" title="{% trans 'Language' %}" />
>
> I've also asked in StackOverflow
> (http://stackoverflow.com/q/16655851/270293) and someone suggested to
> use the "add" functionality, but that doesn't work either. Any ideas?
>
> Regards,
> Oscar
> -- 
> 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+unsubscr...@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?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>  
>  

-- 
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+unsubscr...@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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to