Ticket #10545: 10545.diff

File 10545.diff, 835 bytes (added by Tim Graham, 15 years ago)
  • docs/howto/custom-template-tags.txt

     
    820820
    821821    {% current_time "%Y-%M-%d %I:%M %p" %}<p>The time is {{ current_time }}.</p>
    822822
     823.. admonition:: Variable scope in context
     824
     825    Any variable set to the context will only be available in the same ``block``
     826    of the template in which it was assigned. This behaviour is intentional as
     827    it provides a scope for the variables so that they don't clash with others.
     828
    823829But, there's a problem with ``CurrentTimeNode2``: The variable name
    824830``current_time`` is hard-coded. This means you'll need to make sure your
    825831template doesn't use ``{{ current_time }}`` anywhere else, because the
Back to Top