Template Format

From EPrints Documentation
Revision as of 16:23, 16 April 2012 by Tdb01r (talk | contribs) (Redirected page to API:EPrints/Apache/Template)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Redirect page
Jump to: navigation, search

EPrints 3 Reference: Directory Structure - Metadata Fields - Repository Configuration - XML Config Files - XML Export Format - EPrints data structure - Core API - Data Objects

XML Configuration: EPScript - Control Format (EPC) - Citation - Workflow - Phrase - Template - XPAGE (static pages)

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" />