Skip to content

Commit

Permalink
Merge branch 'master' of git@github.com:jjdelc/django-external-links
Browse files Browse the repository at this point in the history
  • Loading branch information
jjdelc committed Jul 24, 2009
2 parents de5f141 + 5c2d0f6 commit 9d7ba59
Showing 1 changed file with 26 additions and 3 deletions.
29 changes: 26 additions & 3 deletions docs/overview.txt
Expand Up @@ -40,16 +40,39 @@ perform the redirection to the final site
Reference
=========

TemplateTag
~~~~~~~~~~~
TemplateTags
~~~~~~~~~~~~

'external' tag
--------------

This is what you will be using the most, add
{% load external_link_tags %}
anywhere in your templates, now for each external link use
the {% external %} tag:
<a href="{% external "http://example.com" %}">Other site</a>

Which should translate to:
<a href="/external/?link=http%3A%2F%2example.com">Other site</a>
<a href="/external/?link=http%3a%2f%2example.com">Other site</a>

externalblock block tag
-----------------------

On cases where you will have several links in a variable area, say a blog
post or user generated content, you can wrap that around the
{% externalblock %} block

{% externalblock %}
{{ entry.text }}
{% endexternalblock %}

The entry text has this content
{% externalblock %}
My text <a href="http://example.com">my link</a>
{% endexternalblock %}

Will finally render:
My text <a href="/external/?link=http%3a%2f%2example.com">my link</a>


Models
Expand Down

0 comments on commit 9d7ba59

Please sign in to comment.