- All Implemented Interfaces:
- freemarker.template.TemplateDirectiveModel, freemarker.template.TemplateModel
public class UrlDirective
extends Object
implements freemarker.template.TemplateDirectiveModel
Freemarker directive to output the url of an asset or section. Usage:
<@makeurl section=xxx/> or <@makeurl asset=xxx force=long|short rendition=rrr attach=true|false />
If the variant that specifies an asset rather than a section is used then there are three optional parameters
that may be specified:
force: "long" forces the URL to be the full path to the asset, whereas as "short" forces the URL to
be of the form "asset//name.ext"
rendition: If specified this causes a "rendition" query parameter to be appended to the URL with
the specified value. By default, when this is detected on a request it causes the named rendition
of the addressed asset to be delivered.
attach: An optional boolean parameter that causes an "attach" query parameter to be appended to the
generated URL with the specified value. The default behaviour when such a URL is requested is to
return the asset as an attachment to the response. This typically causes a browser to prompt the
user to save the asset rather than opening the asset directly in the browser.
- Author:
- Brian, Chris Lack