summaryrefslogtreecommitdiff
path: root/docs/templates.txt
diff options
context:
space:
mode:
authorJacob Kaplan-Moss <jacob@jacobian.org>2005-07-16 17:13:20 +0000
committerJacob Kaplan-Moss <jacob@jacobian.org>2005-07-16 17:13:20 +0000
commit058c526ef9995fa54d64f5e6362c9f93a935fbb0 (patch)
treeab73b14dc9b102ef2e7a8f81ecbcbeb3e26cd693 /docs/templates.txt
parentfca1ef1d15650d6c2d5b9a35597f057004729ea4 (diff)
Rolled comments from template page into FAQ
git-svn-id: http://code.djangoproject.com/svn/django/trunk@112 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'docs/templates.txt')
-rw-r--r--docs/templates.txt10
1 files changed, 8 insertions, 2 deletions
diff --git a/docs/templates.txt b/docs/templates.txt
index ddf40bac83..b07883cbe8 100644
--- a/docs/templates.txt
+++ b/docs/templates.txt
@@ -97,7 +97,9 @@ your site and defines **blocks** that child templates can override.
It's easiest to understand template inheritance by starting with an example::
- <html>
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<link rel="stylesheet" href="style.css" />
<title>{% block title %}My Amazing Site{% endblock %}</title>
@@ -150,7 +152,9 @@ At that point, the template engine will notice the three blocks in
``base.html``, and replace those blocks with the contents of the child template.
Depending on the value of ``blog_entries``, the output might look like::
- <html>
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<link rel="stylesheet" href="style.css" />
<title>My Amazing Blog</title>
@@ -173,6 +177,8 @@ Depending on the value of ``blog_entries``, the output might look like::
</div>
</body>
+
+
Note that since the child template did not define the ``sidebar`` block, the
value from the parent template is used instead.