= [GenshiRecipes Genshi Recipes]: Replacing `py:layout` with Includes = As noted in GenshiVsKid, Genshi does not support the `py:layout` directive for template reuse. This page shows how the [http://www.kid-templating.org/language.html#layout-templates-py-layout example] from the Kid language specification translates to a functionally equivalent setup in Genshi. Assume the following layout template, stored as `layout.html`: {{{ #!genshi App Name - ${page_title()} ${page_specific_css()}

Now viewing: ${page_title()} of App Name

Default content }}} And the following page-specific template, stored as `page.html`: {{{ #!genshi Content Page 1 of 10
}}} The “trick” here is that the base template is included at the '''bottom''' of the page template. This results in the template functions `page_title()` and `page_specific_css()` being available to the layout template, and the match template defined in the page template being applied to the layout template. When rendered, the following output would be generated: {{{ #!text/html App Name - Content Page 1 of 10

Now viewing: Content Page 1 of 10 of App Name

}}} ---- See also: GenshiRecipes/PyExtendsEquivalent, GenshiRecipes, GenshiVsKid, [wiki:Documentation/xml-templates.html Genshi XML Template Language]