This is a link field for Kirby 3. You can conveniently insert external, file links, email addresses, page links or phone numbers.
fields:
button:
label: Button
type: link
You can optionally define the possible link types (url
, page
, email
, file
, phone
) and their order like that:
fields:
button:
label: Button
type: link
options:
- page
- url
An external URL:
Button:
link: https://www.medienbaecker.com
type: url
A page link:
Button:
link: products/lorem-ipsum
type: page
A file link:
Button:
link: your-file.jpeg
type: file
An email address:
Button:
link: [email protected]
type: email
A phone number:
Button:
link: 123456
type: phone
There's a convenient ->toHref()
method you can use to automatically return the correct href:
<?= $page->button()->toHref() ?>
Email address: mailto:[email protected]
Phone number: tel:123456
Page link: https://www.example.com/products/lorem-ipsum
Put the link
folder into your site/plugins
folder.