Display Templates

ProWiki | RecentChanges | Preferences

Previous: Page Queries

Okay, so we saw in the previous section that you can do a lot with queries. But it would be a major pain to have to put those complex queries onto each page you define. That's why we have display templates. By giving a page a display template, your main page can just define a bunch of properties, and have the display template deal with the formatting.

Display templates are defined using the "DISPLAY_TEMPLATE" property. A page can define its display template like this:

{{DISPLAY_TEMPLATE=ExampleTemplate}}

By putting that on the page, you declare that you do not want this page to actually display itself when someone browses to it. Instead, ProWiki will interpret all of the properties on the page, but then use the display template to do the actual displaying.

For examples of display templates, see The LARP Schema. Suffice it to say, though, that this is a key concept in ProWiki. When describing structured data, you usually don't worry about the formatting of each data page. Instead, those pages just declare properties, and use display templates to render themselves. That way, you get consistent formatting for related pages; moreover, you get identical queries for these related pages.

Conceptually, display templates are similar to CSS or XSL -- a specialized mechanism used to separate data declaration from formatting. But due to the query mechanism, they're actually quite a bit more powerful.

Next: Inheritance


ProWiki | RecentChanges | Preferences
This page is read-only | View other revisions | View source of this page
Last edited September 28, 2004 9:39 pm by h002078d90c04.ne.client2.attbi.com
Search:
Edit: