{% load i18n %} {% load wagtailadmin_tags %} {% comment %} HACK: This template expects to be passed a 'linkurl' parameter, containing a URL name that can be reverse-resolved by the {% url %} tag with no further parameters. Views that have parameters in their URL can work around this by omitting linkurl, which will produce a final URL of the form "?q=123", implicitly preserving the current URL path. Using the {% url ... as ... %} form of the tag ensures that this fails silently, rather than throwing a NoReverseMatch exception. {% endcomment %} {% if linkurl %} {% url linkurl as url_to_use %} {% endif %}