Hi list,

I really like erlyweb.  Once of the problems I'm having with it is
that
some of the idioms required to do common things in the view require a
bit more erlang knowledge than I would like and it would be good if
this
could be abstracted for the common cases to allow designers without
erlang knowledge to still maintain the templates.

For example, to loop over a list the documentation suggests that I
define a function and pass the list off to that.  I'd suggest a
simpler
interface for that would be a FOREACH loop, e.g. :

<% FOREACH {Title, Artist, Songs} = Data %>
Title: <b><% Title %></b><br>
Artist: <b><% Artist %></b><br>
<% FOREACH {Number, Name} = Songs %>
Song <% integer_to_list(Number) %> - <% Name %><br>
<% END %>
<% END %>

This is nothing new, of course, it is a familair construct from
templating systems in other languages and that is really the point,
i.e.
designers are familiar with it.

It would still work the same way under the hood, of course, with the
body of the FOREACH most likely being compiled to an erlang function,
however the interface IMO is nicer.  I can have a go at putting
together
a patch if there is any interest.

Any thoughts?

Thanks.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"erlyweb" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/erlyweb?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to