NAME

Dotiac::DTL::Tag::url - The {% url PATH,[PATH,[...],[PARAMETER=VALUE,[PARAMETER=VALUE,[..]]] [as VAR] %} tag

SYNOPSIS

Template file:

        {% url "forum","thread",variable,"id"=post.id %} {# forum/thread/444/?id=556 #}
        {% url "","forum","thread",variable,"id"=post.id %} {# /forum/thread/444/?id=556 #}
        {% url "http://www.google.com","forum","thread",variable,"id"=post.id %} {# http://www.google.com/forum/thread/444/?id=556 #}
        {% url "http://www.google.com","forum","thread",variable,"id"=post.id as link_url %} {# <nothing> #}
        {{ link_url|upper|safe }} {# HTTP://WWW.GOOGLE.COM/FORUM/THREAD/444/?ID=556 #}

DESCRIPTION

Generates an url from a joined PATH and adds also PARAMETERs with VALUES for get-queries.

When provided with an "as" and a variable name, it will output nothing and save the url into a variable, which can be used for further processing.

the PATH, PARAMETERs and VALUES are automatically url-encoded.

BUGS AND DIFFERENCES TO DJANGO

The normal Django {% url %} tag gets as a first parameter the name of Django-view, since there is no Django backend in this implementation, this is not possible.

When writing the url into a variable, that variable has to be marked safe manually, using the safe Filter (See Dotiac::DTL::Filter)

SEE ALSO

http://www.djangoproject.com, Dotiac::DTL

LEGAL

Dotiac::DTL was built according to http://docs.djangoproject.com/en/dev/ref/templates/builtins/.

AUTHOR

Marc-Sebastian Lucksch

perl@marc-s.de