medienbaecker / kirby-link-field
Kirby Link Field
Installs: 236
Dependents: 0
Suggesters: 0
Security: 0
Stars: 29
Watchers: 2
Forks: 2
Open Issues: 1
Type:kirby-plugin
Requires
This package is auto-updated.
Last update: 2023-05-25 09:23:25 UTC
README
⚠️ This is now a core feature of Kirby 4: https://getkirby.com/releases/4.0/link-field
Link field for Kirby 3
This is a link field for Kirby 3. You can conveniently insert external, file links, email addresses, page links or phone numbers.
Preview
Blueprint
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
By default, the url
, page
and email
options are displayed.
Content file
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: mail@medienbaecker.com type: email
A phone number:
Button: link: 123456 type: phone
Template example
There's a convenient ->toHref()
method you can use to automatically return the correct href:
<?= $page->button()->toHref() ?>
Email address: mailto:mail@medienbaecker.com
Phone number: tel:123456
Page link: https://www.example.com/products/lorem-ipsum
Installation
Put the link
folder into your site/plugins
folder.