Templates XSLTAL

Templates XSLTAL

Intro

TAL is the main templating language used in the Zope world and belongs to the larger concept of Zope Page Templates.

We always wanted to offer something simpler than XSLT for less complex webpages and TAL seems like the perfect match for that. Furthermore as we don't have to reinvent the wheel all the time, the TAL specs have to be proven successful in the Zope world. And TAL has the big advantage, that you can use your favourite XHTML Editor (like GoLive or Dreamweaver) for editing the templates without destroying it.

We just transform the TAL template to an XSLT template (with an XSLT template...). Integration of XSLT templates is also be no problem, if you need the more powerful features of XSLT for some parts.

There's one TAL template in the demo -> http://svn.liip.ch/repos/public/bxcmsdemo/themes/bxcms/template.tal

If you want to use it, replace the xslt stylesheet instructions in .configxml with

<parameter name="xslt" type="pipeline" value="template.tal"/>

Caution: We don't actually use the TAL transformer right now by ourself in live-projects. Therefore it might not be up-to-date or have unknown bugs. But we're still interested in it and will someday further develop it. But of course, if someone else wants to take over that part, just go ahead

What's implemented (from the specs)

  • @tal:condition
  • @tal:content
  • @tal:replace
  • @tal:attributes
  • @tal:repeat
  • @metal:define-macro
  • @metal:use-macro

What's added (and not in the specs)

  • @tal:match (for implementing simple xslt style matchers)
  • @tal:include (for adding external xslt files with matchers or more complicated stuff)

Not implemented yet from the specs

  • @tal:define
  • @tal:omit-tag
  • @tal:on-error (not sure, if we need that, maybe useful for not catched exceptions)
  • @metal:fill-slot
  • @metal:define-slot

Example

See Templates_TAL_Example for more examples

Links

Labels:

Enter labels to add to this page:
Wait Image 
Looking for a label? Just start typing.

These projects are supported by Liip AG