Sets

Using sets, you can meet very complex requirements with minimal amount of code !

The is built using customized versions of the templates which are suitable for dompdf.

Explore the "alahup" project (available when you create a new site) to learn more.

alahup! 1.1 introduces the ability to use differents sets of templates for elements.

By default, the "default" set is used.

You can use another set from the main template:

templates/main.tpl :
{alahup->block zone="1" set="alternate"}

Or, from any element's template, you can switch to another set:

elements/templates/div.tpl :
{if $this.custom.type == "code"}
{render content=$this set="code"} /* the set named"code" will be used */
                                  /* for the children elements of this div   */
{/if}

In this example, the recursion proceeds using the alternate set for all the children elements.

Thankfully, you don't have to redefine every element in alternate sets: missing elements are automatically looked for in the default set.

So, for instance, if you want some elements to be rendered differently in a side block, you can use an alternate set for that side block and just put the files that are different from the default set in the new set.

You can even specify a custom default set for missing elements:

templates/main.tpl :
{alahup->block zone="1" set="alternate" default_set="sidebar"}