Skip to content

inheritance chain argument (default values) passing problem #306

Description

@lv-gh

Maybe it's not a bug at all, but i find argument passing/inheriting in the inheritance chain to be obscure.
Example:

## base.mako
<%page args="x='title',y='description'" />
<base>
	arg 'x': ${x}, arg 'y': ${y}
	<%block name="foo" />
</base>

## inheriting.mako
<%inherit file="base.mako" />
<%block name="foo">
	<title>${x}</title>
	<desc>${y}</desc>
</%block>

And two cases (first works, but second don't):

mylookup.get_template('inheriting.mako').render(x='title', y='description'))
mylookup.get_template('inheriting.mako').render())

Though args with default values are set in <%page> and are valid/visible in the inheritted template (base.mako; note inheriting (inheriting.mako<-base.mako) involved) , but not in the inheriting template and it's named blocks.
I know that i could pass args to named blocks via args param explicitly, but shouldn't <%page args (default values) also be inherited? (render() supplied args are visible in all templates/contexts)
In other wors: is there any posibility to set all arg default values in one place?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions