Difference between revisions of "Template Format"

From EPrints Documentation
Jump to: navigation, search
Line 6: Line 6:
  
 
The title pin should be placed in the title tags of the HTML document, the page pin somewhere in the body, the pagetop at the start of the body section, and the head within the head tags at the beginning of the file.
 
The title pin should be placed in the title tags of the HTML document, the page pin somewhere in the body, the pagetop at the start of the body section, and the head within the head tags at the beginning of the file.
 +
 +
To prevent markup in the <title> tag you can supress it by adding a textonly="yes" attribute to a pin. eg.
 +
 +
<title><epc:pin ref="title" textonly="yes" /></title>
 +
 +
You can also use <epc:print> elements, and the {} equivalent from inside attributes. See [[EPrints Control Format]] for the full details of the syntax. The most useful way to use this inside href attributes to include values from the configuration. For example:
 +
 +
<a href="{$config{perl_url}}/search">Search</a>
 +
 +
or inserting a phrase (eg. ruler)
 +
 +
  <epc:phrase ref="ruler" />

Revision as of 18:09, 6 January 2007

EPrints uses a template file when rendering all pages to ensure a consistent look and feel. The templates folder contains a default.xml file which contains the normal template. Later versions of EPrints may allow additional templates.

The template file is an HTML document, but may also include EPrints Control elements. Four parameters are passed through - title, page, pagetop, and head - and these may be included using a pin element:

<epc:pin ref="head"/>

The title pin should be placed in the title tags of the HTML document, the page pin somewhere in the body, the pagetop at the start of the body section, and the head within the head tags at the beginning of the file.

To prevent markup in the <title> tag you can supress it by adding a textonly="yes" attribute to a pin. eg.

<title><epc:pin ref="title" textonly="yes" /></title>

You can also use <epc:print> elements, and the {} equivalent from inside attributes. See EPrints Control Format for the full details of the syntax. The most useful way to use this inside href attributes to include values from the configuration. For example:

<a href="{$config{perl_url}}/search">Search</a>

or inserting a phrase (eg. ruler)

 <epc:phrase ref="ruler" />