{% with url=object.get_object_url %} {% if url %} {{ value }} {% else %} {{ value }} {% endif %} {% endwith %}