Helma Logo
main list history
previous version  overview  next version

Version 3 by tobi on 15. February 2006, 15:46

From our experience with Helma's skin templating features we came to the following general conclusion for further developments in version 2.0:

# Helma core has to remain as simple as we know it.
# Separation of presentation and logic has priority.
# Backwards-compatibility is required in any way.
# Other concepts (templating engines) should only be considered as pluggable extensions to helma.

That's why we come up with a

== Rather rigid specification ==

# Skin files can contain more than one skin meaning we can have similar structures with skins as we already have with JavaScript functions. (Yes, the skin file's name is irrelevant, then.)
# A skin is identified via a label using a new syntax (open for discussion, I am using hash marks in the example).
# There is only one single level of label hierarchy, ie. a flat collection of labels.
# Skin labels can be used as reference in a macro. This provides both, familiar access to as well as advanced rendering (loops, conditions?) of skins.
# Skins can contain local symbols (or call it variables) containing a string value that can be re-used throughout one single skin.
# Macros in skins are delimited by <% %>.
# There are no nested macros in macros. (I know, this will hardly stand the desire.)
# Object mappings extend the macro handler for easier access to properties of the contained object.

== Rather vague wishes ==

# Each HopObject contains certain macros from scratch (e.g. loop w/ sorting, skin etc.) -> scaffolding!
# HopObject properties and the corresponding form input in a skin (display, check, error messaging) are firmly and closely connected, generally and finally.

== Example file ==

    Hello, <% this.administrator.name %>!
    <% this.render skin="time" %>.
    There are currently <% this.users.size %> other users
    logged in:
    <% this.users.loop skin="user" %>
    <% now format="EEE, dd.MM.yyyy, HH:mm'h'" %>
    Today is <% skin name="now" %>.
    Hello, <% user.name %>!
The imagined output of rendering the above skin:

    Hello, Brian!
    Today is Wed, 15.02.2006, 15:31h.
    There are currently 3 other users logged in: