Ticket #6166: 6166.docs.templates.diff

File 6166.docs.templates.diff, 1015 bytes (added by Pete Crosier, 16 years ago)
  • docs/templates.txt

     
    429429    # base.html
    430430
    431431    {% autoescape off %}
    432     <h1>{% block title %}</h1>
    433     {% block content %}
     432        {% block content %}{% endblock %}
    434433    {% endautoescape %}
    435434
    436 
    437435    # child.html
    438436
    439437    {% extends "base.html" %}
    440     {% block title %}This & that{% endblock %}
    441     {% block content %}<b>Hello!</b>{% endblock %}
     438    {% block content %}{{ greeting }}{% endblock %}
    442439
    443 Because auto-escaping is turned off in the base template, it will also be
    444 turned off in the child template, resulting in the following rendered HTML::
     440Because auto-escaping is turned off in the parent template, it will also be
     441turned off in the child template, resulting in the following rendered HTML
     442when ``greeting`` contains ``'<h1>Hello!</h1>'``::
    445443
    446     <h1>This & that</h1>
    447     <b>Hello!</b>
     444    <h1>Hello!</h1>
    448445
    449446Notes
    450447-----
Back to Top