= [GenshiRecipes Genshi Recipes]: Replacing `py:extends` with Includes = As noted in GenshiVsKid, Markup does not support the `py:extends` directive for template reuse. This page shows how the [http://www.kid-templating.org/language.html#template-reuse-py-extends example] from the Kid language specification translates to a functionally equivalent setup in Genshi. Assume the following base template, stored as `base.html`: {{{ #!xml }}} And the following template “extending” that base template, stored as `page.html`: {{{ #!xml Errors

The following errors were found:

${display_errors(["Field is required", "Must be phone number.."])} }}} The “trick” here is that the base template is included at the top of the page template. This results in the template function `display_errors()` being available to the page template, and the match template being applied to the output generated by the page template. When rendered, these will produce the following output: {{{ #!xml Errors

The following errors were found:

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