Ticket #6166: 6166.docs.templates.diff
File 6166.docs.templates.diff, 1015 bytes (added by , 17 years ago) |
---|
-
docs/templates.txt
429 429 # base.html 430 430 431 431 {% autoescape off %} 432 <h1>{% block title %}</h1> 433 {% block content %} 432 {% block content %}{% endblock %} 434 433 {% endautoescape %} 435 434 436 437 435 # child.html 438 436 439 437 {% extends "base.html" %} 440 {% block title %}This & that{% endblock %} 441 {% block content %}<b>Hello!</b>{% endblock %} 438 {% block content %}{{ greeting }}{% endblock %} 442 439 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:: 440 Because auto-escaping is turned off in the parent template, it will also be 441 turned off in the child template, resulting in the following rendered HTML 442 when ``greeting`` contains ``'<h1>Hello!</h1>'``:: 445 443 446 <h1>This & that</h1> 447 <b>Hello!</b> 444 <h1>Hello!</h1> 448 445 449 446 Notes 450 447 -----