A tour of the templates: Difference between revisions

Content added Content deleted
imported>Paulproteus
imported>Paulproteus
Line 41: Line 41:
* '''pagetop''': Stuff included toward the end of the navigation bar.
* '''pagetop''': Stuff included toward the end of the navigation bar.
* '''footer''': You probably don't want to override this.
* '''footer''': You probably don't want to override this.
* '''js_before_bundle''' and ''js'': If you want to add JavaScript to the page, you can put it here. You should use '''js''' unless you know you have a reason not to.
* '''js_before_bundle''' and '''js''': If you want to add JavaScript to the page, you can put it here. You should use '''js''' unless you know you have a reason not to.
** Note: If you're using this, you should probably talk to us on IRC or the mailing list about adding your JavaScript file to the bundle.
** Note: If you're using this, you should probably talk to us on IRC or the mailing list about adding your JavaScript file to the bundle.

== A tour of a complex template: landing.html ==

This page:

* '''extends''' base.html.

It overrides:

* '''js_in_head''': It uses a quick JavaScript snippet that sets the CSS class of the <html> element to that JavaScript works. This is part of our [http://www.learningjquery.com/2008/10/1-way-to-avoid-the-flash-of-unstyled-content fight against the flash of unstyled content/].

It uses:

* The '''cache''' template tag, so that lots of people loading this popular page doesn't cause us to do a lot of computation.

And then it mostly uses '''module'''s lay itself out. A '''module''' in the OpenHatch CSS is just a box, often with a header.