I plan to create a site using django that will have a common heading throughout the website. I read the django documentation on template inheritance, but I cannot find an elegant solution for the "dynamic" elements in my header.
For example, the title on the website will include tabs, for example, http://www.google.com/ (where it has "Internet", Images ", etc.), where the selected tab will describe your current location on website.
Using django template inheritance, it looks like you will create a basic template like this:
<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>
</head>
<body>
<div id="header">
{% block header %}
.... html to create tabs ...
{% endblock header %}
</div>
and then on all my other pages I would do the following:
{% extends "base.html" %}
{% block header % }
.... html to create tabs with one tab "selected" ...
{% endblock header %}
, HTML , . , , HTML .
, , :
1 - , , , HTML, : {% block header%} {% mycustomtag abc%} {% endblock header%}
, HTML python .
2 - X base.html, . , .
, , X- HTML-, - .
3 - javascript (, jquery), , "" .
, , javascript. , HTML- HTML.
?
!
lawdawg