You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
theres an impoverished way to do this right now, like this:
# child template
<%!
foo='bar'
%>
<%inherit file="base"/>
# base template
foo is ${self.module.foo}
it would be quite easy to put a special accessor on Namespace called attr, which searches the full inheritance tree of modules for the attribute 'foo':
foo is ${self.attr.foo}
but ive only thought about it for 30 seconds. how does that sound ?
Migrated issue, originally created by Anonymous
Need a way to pass python values to the parent template. Possible solutions:
<%inherit> parameters e.g.
<%inherit file="base.mako" args="current_tab='Settings'"/>
<%def> variant for values e.g.
<%def name="current_tab" value="Settings" />
The current way to pass values to base template is by using a <%def>, e.g.:
base.mako
hello.mako
This syntax is pretty verbose, and calling
self.current_tab()
can accidentally result in rendered output.Previous requests for this feature in the mailing list:
http://groups.google.com/group/mako-discuss/browse_thread/thread/5398cd2c3aa0a694
http://groups.google.com/group/mako-discuss/browse_thread/thread/cd01b2821a3a1a57
The text was updated successfully, but these errors were encountered: