diff --git a/README.rst b/README.rst index 6508e613..1daa8bfd 100644 --- a/README.rst +++ b/README.rst @@ -202,17 +202,15 @@ models or forms. To render the link field in a template, use the ``LinkDict`` property ``url`` or the new template tag ``to_url``. The ``type`` property returns the link type:: - {% load djangocms_link_tags %} {# Variant 1 #} {% if obj.link %} - Link + Link available {% endif %} {# Variant 2 #} + {% load djangocms_link_tags %} {% if obj.link %} - Link available + Link {% endif %} {# Variant 3 #} @@ -220,6 +218,12 @@ the new template tag ``to_url``. The ``type`` property returns the link type:: {% if url %} Link available {% endif %} + {% endwith %} + + {% if obj.link.type == "external_link" %} + External link + {% endif %} + To turn the ``LinkField``'s ``LinkDict`` dictionary into a URL in python code, use the ``url`` property. (It will hit the database when needed. Results are