<TEI:TOK>

Main Menu


Powered by TEITOK
© Maarten Janssen, 2014-

TEITOK Help Pages

Using teiHeader Templates

In the view of a manuscript (an XML file), information from the teiHeader can be displayed below the title. Which information to display is defined in the teiHeader Template in a file called teiheader.tpl. The teiHeader consists of a mixture of HTML and XPath code, as in the exmample below.

Author{#//author}
Year{#//publicationStmt/date/@n}

In this example, a table will be displayed with 2 rows and two columns, where the first column is a table header showing the texts Author and Year respectively. The code {%} makes that the text Author is not just displayed, but rahter internationalized so that it will be translated to the interface language the user selected. The second column will show two values lookup up with XPath in the teiHeader. The first will show the results of the XPath query "//author", that is to say, it will display the value of the first element <author> in the XML file. The second row will display the value of the attriibute n in th node <date> directly under the node <publicationStmt>

Sometimes it is desirable to optionally have more information from the teiHeader. To do so, you can create a file teiheader-long.tpl in exactly the same was as the normal template, just with more information. If there is a long header file, the system will display a link more header data, which will swtich from the short header to the long header.


Back to index