Template commands - TuTech/DasCMS GitHub Wiki
All commands have to be assigned to the template namespace to be executed http://www.bambuscms.org/2008/TemplateXML
Via direct xmlns
<foo xmlns="http://www.bambuscms.org/2008/TemplateXML" />
Via indirect xmlns
<bar xmlns="http://www.bambuscms.org/2008/TemplateXML">
<foo />
</bar>
Via prefix
<cms:bar xmlns:cms="http://www.bambuscms.org/2008/TemplateXML">
<cms:foo />
</cms:bar>
Show one property of one specific content
<content alias="demo-2011-02-25" property="Title" />
- alias the content's id or alias
- property the content's property such as "Title"
Call a function from from an template-supporting object referenced by a guid
<controller guid="de.tutech.events" call="test">
<param name="namedParameter" value="testing" />
</controller>
- guid references the class by it's GUID constant
- call call a function if the object permits it
Get a value from the template env
<env get="stuff" />
- get the name of the value to get
deprecated Render the html-head element
<head />
deprecated Render the html-wrapping tags with proper doctype declaration
<html lang="en" doctype="html4"></html>
- lang the language code for this page
- doctype the name of the doctype to use
Get a value from the current runtime array
<runtime get="stuff" />
- get the name of the value to get
Let the cms run tasks async the e.g. (de-)publicise contents
<scheduler interval="10000" />
- interval the time between calls in milli seconds
Render html, head and body tags with proper doctype declaration, automatic css and script loading. Recommended template root element
<site>...</site>
Displays run-time, mem-usage and ip address in hex
<stats />
Displays the given text. Can be used to generate create tags with dynamic attributes
<text value="text" />
<text value="<div class="" />
dynamic element
<text value="">" />
stuff in dynamic div
<text value="</div;>" />
- value the text to display
Embed a Treenavigation
<treenavigation show="navi" />
- show the name of the navigation to show here
Get a URL parameter E.g. in a call like index.php?page=foo this would return foo
<url get="page" />
- get the name of the parameter to show here
The main element to display cms content
Embed content
<view for="page" show="content" />
Embed preview image
<view for="page" show="previewimage" width="100" height="50" scale="1c" />
Embed something defined by a formatter
<view for="page" show="formatter" use="my_content_formatter" />
- for the name of the url to get the alias from
- show what property of the content we want to display [1]
- width if the content is sizeable like an image set the width to render it
- height if the content is sizeable like an image set the height to render it
- scale set the scale method for scaleable content [2]
- color set the background color if the content is stainable like some scaled images
- use use a formatter with the name here
- fixcontent force this field to diaplay always the same content identified by an alias
Things that can appear in a view
- Properties
- content (view)
- description (view)
- title (view)
- subtitle (view)
- pubdate (view) the pubdate in the format set in the config
- author (view)
- tags (view) the tags as csv-string
- previewimage (view, width, height, scale, color)
- type (view) the contents class name
- property (view, use) any named property of the content (title, subTitle, createdBy, ...)
- formatter (view, use) use a formatter to display content here
- Scale options
- 'aspect_fit'
- 'aspect_crop'
- 'aspect_fill'
- 'stretch'