About Sitellite       Screenshots       Downloads       Forge      Documentation       Community       Support

You are here: Home / Documentation / How To: XT Template Essentials

How To: XT Template Essentials

Introduction

First off, this introduction is lifted almost verbatim from my previous article "How To: Templates in Sitellite".  Other than this intro, the rest of this article assumes you understand the overview presented in that article.  A basic understanding of programming concepts is also always helpful, in the event that I get carried away in theoretical ramblings (which I'll try not to ;)).

XT is one of Sitellite's two template languages.  XT stands for eXtensible Templates, as it is an eXtensible Markup Language (XML) -based template language.  XT has its origins in the Zope application server, the Cold Fusion programming language, and a few other technologies as well.  The idea behind XT is that designers need a template language that works with their existing tools, and especially with ordinary web browsers, potentially even outside of the Sitellite environment.

The solution, as originally conceived by the Zope project, is that browsers and editors handle XML tags and attributes that they do not recognize in a very conveniently exploitable way: They ignore them.  So an XT template, while being a mixture of HTML and XML tags, can be viewed in Internet Explorer or any other web browser without the need for Sitellite to pre-process it, making XT templates previewable while designers do their work.  Obviously being able to see what you're doing is key to being able to do your job, and we all know that the less time you spend fighting with technology the more time you can focus on being creative.

XT actually takes the idea of previewability to a whole new level though, by allowing fake content to be inserted into templates that is automatically replaced with real content when they're inserted into Sitellite.  This is important to being able to make changes and see how they will actual affect your content.

Of course, as you're probably thinking, XML isn't the easiest thing for designers to use.  However, neither is PHP, or any other custom-made template solution ({$tags[tag].keyword} anyone?).  However, the ease-of-use differentiator in any technology is not how simple it is (read: limited), but how good the documentation and support is.  So for any given solution, your mileage may vary.

Initial Setup

For the purposes of this article, duplicate the folder named "default" inside inc/html and call the duplicate folder "essentials".  Next open up the file inc/conf/config.ini.php and change the value "default_template_set" to "essentials".  This will cause Sitellite to use our new template set to display your Sitellite test web site (you are doing this on a test server, not your live web site, right? ;)).

I should also mention before we start that XT templates must be valid XML documents, or you will get a nice ugly error message instead of a web site.  This is why the examples below will be wrapped in either <xt:tpl> tags, or <html> tags, whichever best suits each example.

Next Up: First Steps

Page 1: Introduction
Page 2: First Steps
Page 3: Substitutions (Part 2)
Page 4: Conditions
Page 5: Loops
Page 6: Includes
Page 7: Boxes
Page 8: I18n
Page 9: XT Object Reference

All Tutorials

Members

Note: You can use your SitelliteForge.com account here and vice versa.

Username

Password

Forgot your password?

Not a member? Click here to register

Sitellite 5 Beta


Copyright © 2008, SIMIAN systems Inc.
All rights reserved. Privacy policy
Some of the icons on this site were created by the Gnome Project.