tags:

views:

9

answers:

1

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 into an href( i prefer NOT to combine them on the server side):

<a href="http://maps.google.com/maps?daddr=&lt;!-- OVER HERE --!>">Map It</a>

thanks!

+1  A: 
<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 %}">
Ned Batchelder