A tour of the templates: Difference between revisions

imported>Paulproteus
No edit summary
imported>Paulproteus
Line 29:
 
=== Generally useful template blocks for the <body> ===
 
The most useful one:
* '''content''': This is where the main page content goes. Probably, you're not going to be using base.html directly; you'll be inheriting from some page that inherits from it. That page will probably wrap your content in some more fluff.
 
* '''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.
* '''nav''': This adds the top navigation links.
* '''greeting'': Some view functions set the "explain_to_anonymous_users" flag.
** Note: In my opinion, the greeting block should be extracted out, like '''greeting''.
* '''pagetop''': Stuff included toward the end of the navigation bar.
* '''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.
** 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.
Anonymous user