medienbaecker/kirby-link-field

此包已 弃用 并不再维护。没有建议的替代包。

Kirby 链接字段

安装: 236

依赖项: 0

建议者: 0

安全: 0

星标: 29

关注者: 2

分叉: 2

开放问题: 1

类型:kirby-plugin

1.0.1 2019-04-25 12:26 UTC

This package is auto-updated.

Last update: 2023-05-25 09:23:25 UTC


README

⚠️ 现在这是 Kirby 4 的核心功能:[点击访问](https://getkirby.com/releases/4.0/link-field)

Kirby 3 的链接字段

这是 Kirby 3 的链接字段。您可以方便地插入外部链接、文件链接、电子邮件地址、页面链接或电话号码。

预览

Preview

蓝图

fields:
  button:
    label:  Button
    type:   link

您可以可选地定义可能的链接类型(urlpageemailfilephone)及其顺序,如下所示

fields:
  button:
    label:  Button
    type:   link
    options:
      - page
      - url

默认情况下,将显示 urlpageemail 选项。

内容文件

外部 URL

Button: 

link: https://www.medienbaecker.com
type: url

页面链接

Button: 

link: products/lorem-ipsum
type: page

文件链接

Button: 

link: your-file.jpeg
type: file

电子邮件地址

Button: 

link: mail@medienbaecker.com
type: email

电话号码

Button: 

link: 123456
type: phone

模板示例

有一个方便的 ->toHref() 方法,您可以使用它自动返回正确的 href

<?= $page->button()->toHref() ?>

电子邮件地址:mailto:mail@medienbaecker.com 电话号码:tel:123456 页面链接:https://www.example.com/products/lorem-ipsum

安装

link 文件夹放入您的 site/plugins 文件夹。