User Tools

Site Tools


devel:blueprints:django_template

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
devel:blueprints:django_template [2010/01/13 12:04]
eide About context processors.
devel:blueprints:django_template [2010/01/13 12:16] (current)
eide a little 'bout the base template
Line 5: Line 5:
 ===== Django systems ===== ===== Django systems =====
  
-Something smart here+In the lib-python directory there'​s a base template, simply called base.html. Subsystems should extend this one (probably with their own base.html) and the base_content block in it. 
 + 
 +base.html provides the header and footer for pages, so subsystems need only contribute the content.
  
 ==== Context processors ==== ==== Context processors ====
Line 21: Line 23:
      ​RequestContext(request)      ​RequestContext(request)
 ) )
 +</​code>​
  
-Currently these context processors ​are: debug, account and nav_version. +^   ​NAV ​context processors ​  ^^ 
- +debug Provides a SQL debug table at the bottom of every Django page if the DEBUG setting is set to true. | 
-=== Debug === +| account_processor | Provides account object for current user, a flag telling if he/she is and admin, messages for the user and custom ​navigation bar| 
- +nav_version ​| The version number from nav.web.buildconf ​
-Provides a SQL debug table at the bottom of every Django page if the DEBUG setting is set to true. +| toolbar | All available tools from the toolbox (not enabled by default) |
- +
-=== Account_processor === +
- +
-Provides ​the account object for the current user, a flag telling if he/she is an admin, messages for the user and the custom ​links found in the navbar (includes quick links)+
- +
-=== nav_version ​=== +
- +
-Returns the version number from nav.web.buildconf+
  
 ==== Template blocks and variables ==== ==== Template blocks and variables ====
Line 65: Line 60:
  
 Compability with Django templates are done seamless. The MainTemplate includes nav.webfront.compability.Cheetah which provides two methods called footer and header. These two methods are simply printed, and thus the header and footer appears. Compability with Django templates are done seamless. The MainTemplate includes nav.webfront.compability.Cheetah which provides two methods called footer and header. These two methods are simply printed, and thus the header and footer appears.
 +
 +MainTemplate will automatically populate the needed instance variables for the Cheetah compability class.
  
 ==== Additional <​head>​ content ==== ==== Additional <​head>​ content ====
devel/blueprints/django_template.1263384281.txt.gz · Last modified: 2010/01/13 12:04 by eide