<?xml version="1.0" encoding="utf-8"?>
<page xmlns="http://projectmallard.org/1.0/" style="xslt-template" id="mal.link.sorttitle">
 <info>
  <link type="guide" xref="mal-link" group="templates"/>
  <link type="guide" xref="templates" group="mal"/>
  <desc>Output the sort title for a page or section.</desc>
  <revision version="3.10" date="2013-07-30" status="final"/>
 </info>
 <title>mal.link.sorttitle</title>
 <synopsis>
  <title>Parameters</title>
  <terms>
   <item>
    <title><code>$node</code></title>
    <p>The <sys>page</sys> or <sys>section</sys> element to output a sort title for.</p>
   </item>
   <item>
    <title><code>$role</code></title>
    <p>A space-separated list of link roles, used to select the appropriate title.</p>
   </item>
  </terms>
 </synopsis>
 <p>This template returns a sort title for a page or section as a normalized string.
 If <code>$node</code> defines a sort title in its <sys>info</sys> element, the value of that title
 is always used first. Otherwise, if <code>$role</code> is defined and <code>$node</code> has a link
 title with a matching role, that title is used. Otherwise, if <code>$node</code> has a link
 title with no role, that title is used. Otherwise, the primary title is used.</p>
</page>
