[Helma-user] Javascript Template Engine, Sub Templates
VividVisions, Walter Krivanek
walter.krivanek at vividvisions.at
Tue Dec 5 16:32:57 CET 2006
Hi Jürg,
are there any up-to-date benchmarks regarding the performance of
using JSTL Templates in contrast to Helma Skins?
What is your testing setup?
> - prefix / suffix / default handling for loops: Are they added to
> each iteration or the whole output?
I'd expect them to replace/be added to the whole output.
Thanks a lot!
Walter
Am 08.11.2006 um 02:30 schrieb Juerg Lehni:
> I added the possibility of sub templates to my template engine today,
> as a proof of concept:
>
> http://dev.helma.org/Wiki/JavaScript+Template+Engine/
>
> The syntax and naming is not fixed, but so far it works well for me,
> so I thought I should share it.
>
> This also had the side-effect that templates can now be created from
> strings like this:
>
> new Template(str);
>
> I think it should be very easy to create a JS only version from the
> current code that could run on the client side.
>
> One discussion that is still open is the problem with closing tags
> for nested content (</%>). In my email from 27.10.06 that remained
> unreplied so far I wrote about this, among many other open template
> questions:
>
> http://grazia.helma.at/pipermail/helma-dev/2006-October/003166.html
>
> - Nested content: So far it has been said they should use <% end %>
> instead of </%> as the end tag, for more consistency. I just realized
> today why this is not as easy as we hoped, and why I have come up
> with the current scheme. Look for example at this situation:
>
> <% foreach (value in list) %>
> <% value.macro %>
> Some HTML
> <% end %>
>
> It would be good to hear reactions about this problem, and also about
> the other questions in my post.
>
> Bellow some examples of sub templates. Comments are welcome.
>
> Jürg
>
> ---
>
> Definition:
>
> <% template "name">
> This is a sub-template. It can call <% macros %> and write <%=
> param.value %> too!
> </%>
>
> Rendering:
>
> <% render "name" value="variables" %>
>
> Rendering of normal templates:
>
> <% this.render "name" foo="bar" %>
>
> Definition and rendering into a variable in one command:
>
> <% set "text">
> Render this text into 'name'. <% macros %> can be called.
> </%>
>
> This can now be used like a normal variable, and for example be
> passed as
> the default value in another macro:
>
> <%= text %>
>
> <% do_something default=text %>
> _______________________________________________
> Helma-user mailing list
> Helma-user at helma.org
> http://helma.org/mailman/listinfo/helma-user
>
More information about the Helma-user
mailing list