EPrints Control Format

From EPrints Documentation
Revision as of 16:38, 3 January 2007 by Moj (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

EPrints Control

Output Tags

epc:print

<epc:print expr='expression' opt='key=value;key2=value2'/>

Outputs the result of the expression in the 'expr' attribute. Rendering options may be passed in the opt attribute using a key=value form, with semicolons separating multiple options.


epc:phrase

<epc:phrase ref='phraseid'>
  <epc:param name='somepin'>Content</epc:param>
</epc:phrase>

Outputs the content of the phrase refered to by 'ref'. Any necessary parameters may be set using the <epc:param> tag, with the contents inserted into the pin with the name corresponding to the name attribute.

Conditional Tags

epc:if

<epc:if test='expr'>
...
</epc:if>

Outputs any XHTML content and evaluates any EPrints Control structures within the epc:if block if the expression in the test attribute is true.

epc:choose

<epc:choose>
  <epc:when test='expr'> 
  ...
  </epc:when>
  <epc:when test='expr2'> 
  ...
  </epc:when>
  <epc:otherwise>
  ...
  </epc:otherwise>
</epc:choose>

epc:choose allows for the construction of a complex conditional. Each epc:when block's 'test' attribute is evaluated, and the content of the block is returned if the result is true. If no expressions return true, the optional epc:otherwise block is returned. Note that no subsequent epc:when blocks are evaluated once the first block to return true is reached.