Jump to content

A tour of the templates: Difference between revisions

no edit summary
imported>Paulproteus
imported>Paulproteus
No edit summary
Line 10:
* Our templates make extensive use of template inheritance. You can read more about that in the Django documentation, or in [http://jeffcroft.com/blog/2006/feb/25/django-templates-the-power-of-inheritance/ this nice article]. The inheritance feature lets use replaceable, named ''blocks''.
* The OpenHatch code is broken up into different Django ''apps''. The [http://gitorious.org/openhatch/oh-mainline/blobs/master/LAYOUT LAYOUT file] explains these apps a little bit.
 
== Who should read this? ==
 
You should read this if you are:
 
* Writing a new page, and want to get a sense of how things work together
* Curious to learn how we use Django templates
 
== Begin at the begin: base.html ==
Line 17 ⟶ 24:
=== Important template blocks in the <head> of the document ===
 
* '''title''': If you want your page to have a custom HTML TITLE, override the title block. It gets wrapped inside the '''whole_title''' block.
* '''js_in_head''': You can override this if your page
* '''js_in_head''': You can override this if your page needs to add JavaScript tags to the <head> section of the HTML document. Use sparingly, as putting JavaScript here will cause the browser to wait for the script to load before rendering the document.
* '''css''': If you want to add custom CSS, you can add it by extending this block. Be sure to call {{ block.super }} at the top if you do that, or else you'll accidentally erase a bunch of main site CSS.
 
=== Generally useful template blocks for the <body> ===
 
* '''body_id''' and '''body_class''': If you want your page to provide a hint to CSS as to what page it is, you can use these.
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.