[Grok-dev] Accessing a METAL template from another template
uli at gnufix.de
Tue Jan 15 09:34:55 EST 2008
Sebastian Ware wrote:
> Unfortunately it only covers accessing a template from the current
> view. This page explains what I am trying to do:
The master template in the macros tutorial Daniel pointed to, is a
template for instances of ``Master`` view, which is not your 'current'
view. Please review the 'all-purpose-macros' section.
There is no limit in setting up 'masters' of 'masters'. Given you have a
main template 'master.pt', which is bound to a view 'Master' (as done in
then you can define::
grok.context(Interface) # Same as in the `Master` class
or, for short::
Add a template ``monkeybutter.pt`` in `app_templates/` which references
the old master template as `context/@@master/macros/master` and
reference the new fascade macros from, for example, indext.pt like
simply replacing '@@master' by '@@monkeybutter'.
I assumed, this would be made clear in the tutorial. Maybe I should
explain it more in-depth.
BTW: In the macros-tutorial all macro references are shown as::
This is now deprecated and you should use instead::
(with explicit 'macros/'). I will update this shortly.
Hope that helps,
More information about the Grok-dev