Nathan Bubna wrote:
#callBlock(collapsibleSection {"isCollapsed":$collapsed, "title":"My
Section"})
My section content.....
#end
Where your collapsibleSection.vm file could look like this:
<table><th><td>$args.title</td></th>
#if($args.open)
#content()
#end
</table>
#end
Where the #content() directive will just render the body of the
callBlock directive - in this case " My section content.....".
these look like a great improvements on #parse.
So have a look at the attached code, if you have similar problems with
macros - it is quite short and should be easy to understand.
Maybe something like this should be added for the 1.6 version - or the
whole macro concept could be converted to a solution like that - leaving
the existing syntax intact.
i'm totally interested. no time to look at the code today, but i
would love to have something like #parse but with a little more
control over the variables/namespace.
Best regards,
Guido Deinhammer
Btw: we have also added another cool directive that allows partial page
rendering...but I didn't have time to write it up yet...
interesting. seems like new ideas are starting to pop up. :)
<LOL>
Nathan, these aren't new ideas. Basically, all of these things have been
implemented in FreeMarker for 5, even 6 years. Okay, I grant that you
could say they are "new" insofar as they would be new in Velocity. But
still, it seems to me that, if you're serious about doing work in some
application space, there has to be some notion of an existing state of
the art, and you can't be referring to things that are longstanding
features in other tools in the space as "new ideas". It's like as if I
wrote a vanilla text editor, and then started saying that something like
syntax highlighting was an exciting new feature. Well, I suppose it
would be if you never looked at a state of the art programmer's editor....
i have
one i'm excited about, but i'm not quite ready to put it out there for
community vetting.
Gee, I wonder which of the things on this page that might be....
http://freemarker.org/features.html
in any case, if we can't work some of these new ideas into 1.6 proper,
it would be great to at least get them in 1.6's whiteboard at a very
minimum to make it easier for people to start playing with them.
Well, yeah, but I think it's fair comment to say that people in our user
community are not "playing with" these "new ideas". They simply use
them, in production code and so on, at this stage, things like macro
invocations with associated blocks, and default and unordered parameter
lists and so on, are longstanding features that have been there in a
stable form for 5 years or more.
Jonathan Revusky
--
lead developer, FreeMarker project, http://freemarker.org/
Velocity or FreeMarker: Looking at 5 Years of Practical Experience
http://freemarker.blogspot.com/2007/12/velocity-of-freemarker-looking-at-5.html
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]