<?xml version="1.0" encoding="utf-8"?>
<page xmlns="http://projectmallard.org/1.0/" style="xslt-template" id="mal.link.target">
 <info>
  <link type="guide" xref="mal-link" group="templates"/>
  <link type="guide" xref="templates" group="mal"/>
  <desc>Output the target URL for a <sys>link</sys> or other linking element.</desc>
  <revision version="3.28" date="2017-08-11" status="final"/>
 </info>
 <title>mal.link.target</title>
 <synopsis>
  <title>Parameters</title>
  <terms>
   <item>
    <title><code>$node</code></title>
    <p>The <sys>link</sys> or other element creating the link.</p>
   </item>
   <item>
    <title><code>$action</code></title>
    <p>The <sys>action</sys> attribute of <code>$node</code>.</p>
   </item>
   <item>
    <title><code>$xref</code></title>
    <p>The <sys>xref</sys> attribute of <code>$node</code>.</p>
   </item>
   <item>
    <title><code>$href</code></title>
    <p>The <sys>href</sys> attribute of <code>$node</code>.</p>
   </item>
  </terms>
 </synopsis>
 <p>This template outputs a URL for a <sys>link</sys> element or another element using
 linking attributes.  If <code>$xref</code> points to a valid page or section, it uses
 a file name based on the ID of the target page plus <code xref="mal.link.extension">mal.link.extension</code>.
 Otherwise, the link will point to <code>$href</code>.</p>
 <p>For inline links, <code>$node</code> should be the <sys>link</sys> element. For links from a
 <sys>links</sys> element, <code>$node</code> should be that <sys>links</sys> element, or the containing
 element when the <sys>links</sys> element is implicit.</p>
 <p>This template first calls <code xref="mal.link.target.custom">mal.link.target.custom</code> with the same arguments.
 If that template returns a non-empty string, it is used as the return value,
 overriding any other behavior of this template.</p>
 <p>If <code>$xref</code> contains a <sys>/</sys> or <sys>:</sys> character, this template calls
 <code xref="mal.link.target.extended">mal.link.target.extended</code>, which by default just uses <code>$href</code> instead.
 Override that template to provide extended xref behavior.</p>
 <list style="compact">
  <title>Calls Parameters</title>
  <item>
   <p><link xref="mal.cache"/></p>
  </item>
  <item>
   <p><link xref="mal.cache.file"/></p>
  </item>
  <item>
   <p><link xref="mal.link.default_root"/></p>
  </item>
  <item>
   <p><link xref="mal.link.extension"/></p>
  </item>
  <item>
   <p><link xref="mal.link.prefix"/></p>
  </item>
 </list>
 <list style="compact">
  <title>Calls Templates</title>
  <item>
   <p><link xref="mal.link.target.custom"/></p>
  </item>
 </list>
</page>
