One simple way to think about template inheritance (which is a GREAT
feature) is to think
of it as "specialization":

You first define the general look of a website, the logo, banner, menu
bars, footers.
All that goes into the base template A. In fact, you can render just
the base template A
and see an "empty" site.

Then for each actual website page, you have a template B that defines
the "insides"
of the base template, e.g. the main content area. As your page
specific view
renders the specialized template B, which only contains the "insides",
the django
template engine puts B within the context of A, and renders a full
page with the almost
all of A with one or more blocks replaced by specific content supplied
by B.

B will have none of the HTML elements that make up most of the final
web page.
It only contains the bits that need to be inserted into a {% block %}
inside A.

The neat thing about the django system is that B can replaces multiple
parts of A.
For example, a site has a two column type display, each column is a {%
block %}
that can be replaced. You can write a B1 page that just replaces what
is in column A,
or you can write a page B2 that replaces both columns in A.

P.K.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to