[ xmlSE . how to . edit an html template ] edit
To edit an html template, go to the configure site page. Under the 'browsers' heading there should be a list of browser versions of the site, and each browser version should have a list of templates. When you find the template you want to edit, follow the 'edit' link next to the name of the template.
Enter your name and password at the prompt.
The html field should contain the existing template for the page. The template is plain html, except that lines beginning with '#' are comments, and there are four special template tags:
'<header>', '<header title="my web site" />' - the header tag is replaced with the contents of the browser header field, and if the header tag contains 'title="my web site"', and the browser header field contains a '<title />' tag, it is replaced with '<title>my web site</title>'
'<footer />' - the footer tag is replaced with the contents of the browser footer field
'<data field="picture.url" />' - the data tag is replaced with the contents of the field named in the 'field' attribute, where fields are separated from subfields with a '.'. For example, if you want to put a person's picture on the people record page, and the person record has a 'picture' field with an 'url' subfield, you code the image like this: '<img url="<data field="picture.url" />" />'. If the field potentially contains a lot of text, and you only want to show the beginning of it, use the 'length' attribute, that number of characters from the beginning of the field will replace the tag instead of the entire contents: '<data field="text" length="100" />'.
'<if field="picture.url">...</if>' - the if tag allows you to test for empty fields and only print relevant parts of the template. If in the above example, you didn't want to have a broken image when a person hadn't provided a picture, you would wrap the image tag in if tags: '<if field="picture.url"><img url="<data field="picture.url" />" /></if>'. They can be nested, in which case the outside tags are tested first.
When you are finished, hit the 'update' button, and the updated template will be written to the 'browser_templates.xml' file. If the template is for the index page, or for a category index or record, the changes will not be reflected until you build the site again.
last updated 2.28.2002 by administrator