Usage:
- Place this code in your application_dir/templatetags/add_get_parameter.py
- Make sure you didn't forget to create __init__.py in templatetags directory
In template:
{% load add_get_parameter %}
<a href="{% add_get_paramater param1='const_value',param2=variable_in_context %}">
Link with modified params
</a>
It's required that you have 'django.core.context_processors.request' in TEMPLATE_CONTEXT_PROCESSORS or request in context.
Complete code in dangosnippets: http://djangosnippets.org/snippets/2105/
No comments:
Post a Comment