The extends feature is really nice in Django. It's not the php
includes where everything has to be in a block in order and extended
that way. Essentially that means you want all of your base block html
elements in the base and then the higher you go the more detailed you
can get.

Using your example:

base_header.html:
{% extends 'base.html' %}
{% block title %}Your title here{% endblock %}
{% block content %}you could put content here{% endblock content %}


new base.html:

<html>
<head>
<title>{% block title %}{% endblock title %}</title>
<body>
{% block content %}{% endblock %}
</body>
</html>

You could take this further and create content.html

{% extends 'header.html' %}

{% block content %}
You can put more content here
{% endblock content %}

You could use includes as well but they only carry blocks of text, I
believe, and not the various content blocks.


--~--~---------~--~----~------------~-------~--~----~
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