I want to url encode the following inside template
{{address.street}} {{address.city}} {address.state}}
is there anyway to do this on the template side and place it int开发者_开发问答o an href( i prefer NOT to combine them on the server side):
<a href="http://maps.google.com/maps?daddr=<!-- OVER HERE --!>">Map It</a>
thanks!
<a href="http://maps.google.com/maps?daddr={{address.street|urlencode}} {{address.city|urlencode}} {{address.state|urlencode}}">
I'm not sure how you wanted to combine them, I just used a space. Or:
<a href="http://maps.google.com/maps?daddr={% filter urlencode %}{{address.street}} {{address.city}} {{address.state}}{% endfilter %}">
精彩评论