A tour of the templates: Difference between revisions

From OpenHatch wiki
Content added Content deleted
imported>Paulproteus
No edit summary
imported>Paulproteus
Line 12: Line 12:


== Begin at the begin: base.html ==
== Begin at the begin: base.html ==

All web pages that render into HTML eventually extend from base.html. You can look at the [http://gitorious.org/openhatch/oh-mainline/blobs/master/mysite/base/templates/base/base.html current version in Gitorious, on the web].

=== Important template blocks in the <head> of the document ===

* '''js_in_head''': You can override this if your page

Revision as of 20:19, 14 February 2011

This is a page about improving or modifying OpenHatch.

We call that "Hacking OpenHatch," and there is a whole category of pages about that.


The OpenHatch site has a lot of Django template files. This page explains what they are and how they work together.

Background knowledge

This page uses the following terminology:

  • A template file is a file (e.g., mysite/base/templates/base/base.html) that usually ends in ".html")
  • Our templates make extensive use of template inheritance. You can read more about that in the Django documentation, or in this nice article. The inheritance feature lets use replaceable, named blocks.
  • The OpenHatch code is broken up into different Django apps. The LAYOUT file explains these apps a little bit.

Begin at the begin: base.html

All web pages that render into HTML eventually extend from base.html. You can look at the current version in Gitorious, on the web.

Important template blocks in the <head> of the document

  • js_in_head: You can override this if your page