Return to Snippet

Revision: 5181
at February 17, 2008 10:03 by wackysalut


Initial Code
## base.html
  <head>
    <!-- blah blah -->
    ${self.head()}
  </head>
<%def name="head()">
## Base definition (empty), override in subtemplates, and call
## ${parent.head()} somewhere in your definition.
</%def>


## layout1_base.html
<%inherit file="base.html" />

<%def name="head()">
  ${parent.head()}
  <script type="text/javascript" src="/js/mootools.v1.11.js"></script>
</%def>


## view for controller X
<%inherit file="layout1_base.html" />
<%def name="head()">
  ${parent.head()}
  <link rel="stylesheet" type="text/css" href="/css/woohoo.css" />
</%def>

Initial URL

                                

Initial Description
This allows you to collect some snippets of  or  tags from any subtemplate, and place them in the  of your base template, no matter how you skip some templates in the chain.

Note how you could skip the definition of head() in the layout1_base.html file.

Initial Title
Insert stuff into  from any subtemplate

Initial Tags

                                

Initial Language
HTML