This generates a URL pointing to an attachment.


Id to the content holding the attachment.
Path to the content holding the attachment.
Name to the attachment.
Label of the attachment. Default is source.
Set to true if the disposition header should be set to attachment. Default is false.
URL type. Either server (server-relative URL) or absolute. Default is server.
everything else
Custom parameters to append to the url.

Usage in Thymeleaf:

<a data-th-href="${portal.attachmentUrl({'_download=true'})}">Link</a>

Usage in XSLT:

<xsl:stylesheet version="2.0" exclude-result-prefixes="#all"

  <xsl:template match="/">
    <xsl:value-of select="portal:attachmentUrl('_download=true')"/>