Helma Logo
main list history
previous version  overview  next version

Version 14 by tobi on 15. February 2006, 16:00

From our experience with Helma's skin templating features we came to the following general conclusions 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 three hash marks in the example).
# There is only one single level of label hierarchy, ie. a flat collection of labels.
# Skin labels are to be used as reference in functions and macros. This provides both, familiar access to as well as advanced rendering (loops, switch/case-like 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 embedding 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 ==

    <% greeting="Hello" %>
    <% greeting %>, <% 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 <% this.render skin="now" %>.
    <% greeting %>, <% 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:
    Hello, Adele!
    Hello, Carver!
    Hello, Diane!