Helma Logo
main list history
previous version  overview  next version

Version 10 by tobi on 20. July 2006, 14:10

Just for a simple test implementation I've created two files as attached to this wiki page. (Could be that there's a markup to link them here in the text; alas I don't know it.

<% this.attachments %>

renderSnippet takes two arguments just as renderSkin does: the first defines the snippet, the second the usual param object.

The snippet argument is composed of the file name (without the extension -- which is <code>.snippets</code>, btw.) and the snippet's name. Both values are separated by a colon.

Here's an example call:

<code>renderSnippet("html:image", {src: "http://dev.helma.org/static/xmlbutton.gif"});</code>

This would (or should) render the "image" snippet which is contained in the file <code>Global/html.snippets</code> (currently only global snippets are supported).

A snippets file contains HTML markup with Helma macros as we know it. But furthermore, a special tag (which is an HTML comment in disguise and its syntax is still not carved in stone) marks the beginning of a snippet:

<code><!snippet:image></code>

Each snippet ends right before the next one begins -- or at the end of the file, resp.

Well, it's all done very quickly and without a lot of error testing or checking, but IMHO it proves the point of subskins pretty well.

     removed
     added