Skip to content

Kirby 4.1.2

(file: …)

Creates a download link for any file

Attributes

In addition to the main file, option, the tag supports the following attributes: class download rel target text title

Attribute Description Default
class The class which is added to file link null
download The download attribute that is added to file link true
rel The rel attribute that is added to file link null
target The target attribute that is added to file link null
text The text that is added to file link null
title The title attribute that is added to file link null

Attribute defaults from config

You can customize the defaults of this tag's attributes via the kirbytext.file config option.

Examples

(file: companysecrets.pdf)
(file: companysecrets.pdf text: Download our company secrets)
(file: some/other/page/companysecrets.pdf text: Download our company secrets)
(file: http://example.com/companysecrets.pdf text: Download their company secrets)
(file: companysecrets.pdf title: Download our company secrets)
(file: cv.pdf text: My CV rel: me)
(file: companysecrets.pdf target: _blank)
(file: companysecrets.pdf class: download)

To avoid direct downloads you can set the download option to false:

(file: companysecrets.pdf download: false)