Re: Can I make user-defined directives part of a hash?
Daniel Dekany <[email protected]>
| Newsgroups | gmane.comp.web.freemarker.user |
|---|---|
| Message-ID | <[email protected]> |
Wednesday, August 17, 2011, 12:33:07 AM, Chris wrote:
> Suppose I have a data model with some hash variables. The hash variable
> "foo" returns a TemplateDirectiveModel named "bar". How do I call it
> within a template?
>
> These don't work:
>
> ${foo.[@bar param=value/]}
(A strange attempt. ${...} is for interpolations, not for directive
calls.)
> [@foo.bar param=value/]
This last should work. What's the error message?
> On a related note, it would be nice to be able to temporarily set the
> root of the data model to a subvalue. Then you could go:
>
> [#assign root = root.foo]
> [@bar param=value/]
> // then set it back here
>
> It would be like namespacing parts of the data model and then setting
> the current namespace.
Certainly, however that change should be scoped lexically (right?), so
it's certainly not trivial to implement. But yeah, I know of
situations that needs multiple data-models...
--
Best regards,
Daniel Dekany
------------------------------------------------------------------------------
Get a FREE DOWNLOAD! and learn more about uberSVN rich system,
user administration capabilities and model configuration. Take
the hassle out of deploying and managing Subversion and the
tools developers use with it. http://p.sf.net/sfu/wandisco-d2d-2