Fork me on GitHub

Understanding Templates

The layout in zena is defined by a “Skins”: consisting of zafu templates and assets (images, stylesheets, and javascripts). Make sure you see the zafu tutorials or this video about this.

TODO:

Explain Zazen, Zafu, Rubyless and SQLiss – Where, what, principles, creating,
importing/exporting.

Motivate zafu and SQLiss query language: Unlike allowing cms-users to edit erb templates (an erb has access to the whole cms or even server account), providing zafu and sqliss don’t risk the security of the website, besides their amazing feature to create dynamic and interactive websites with just some template code in a straight forward way. (i.e. simple use of database queries and objects that include the “virtual” classes that that can be defined in the zena admin interface without requiring database schema changes or migrations.)

Allowing only text content in a markup language like zazen (textile, or markdown) is safer, and also preferable to html, because simplifies separating information and formatting.

Zazen

This is the textual content usually generated by endusers. The format is based on textile with some zena enhancements.

For example, “h2.” introduces a second level header and the above “Zazen” is created with ”h2. Zazen” (the 1. level usually is the tiltle). A help page with the most often used formatting rules is available directily in the editor window.

Does Zazen allow users to include (pre-made) zafu parts?

Zafu

This is zenas template language and your magic want. It can be embedded into HTML code, that you may have generated by any means, without invalidating the HTML.

Zafu not only lets you define the presentation of information, but also the editing and interaction???.

To understand zafu, you just need to know that tags with a “do” attribute, as well as tags starting with ”<r:”, will transform the tagged content. You then read the names of the specified methods and (most of the time) you can easily guess what is happening.

Here is an example of a simple html template part that has been made dynamic with zafu:

<div id='content'>
  <div class='left column'>
    <h2>Welcome to our site!</h2>
    <p do='title'/>
  </div>
  <div class="right column">
    <r:include template='sidebar'/>
    <ul do='pages'>
      <li do='each' do='link'/>
    </ul>
  </div>
</div>

Remember that you can make your templates modular and let them include each other partial templates. Using filesystem skins that you can easily sync over the network (unison) is also very usefull when working on larger projects.

Do you want HAML?

Is it possible to build non-html documents (email content) with zafu?

Zafu makes use of SQLiss and Rubyless, to provide the full power the over content, while maintaining the securty of the website.

SQLiss

Get the dataset you want from the database, easily.

Rubyless

Would you like to check some conditions and do some calculations before presenting information?