apecave/kirby3-text-proxy-field
Composer 安装命令:
composer require apecave/kirby3-text-proxy-field
包简介
Text field that can optionally proxy the placeholder value using the kirby query language
README 文档
README
Text field that can optionally proxy the placeholder value using the kirby query language.
Overview
1. Use Case
A developer wishes to make a meta_description field allowing the user customize the page meta description for better seo. The default fallback value would be from the $page->lede(). In this case it would be nice to be able to show the user data from the $page->lede() field as a placeholder value so the user can see what the fallback value would be.
2. Installation
Download and copy this repository to /site/plugins/kirby3-text-proxy-field
Alternatively, you can install it with composer: composer require apecave/kirby3-text-proxy-field
3. Configuration
The blueprint field would look something like this:
fields: meta_description: type: text-proxy placeholder: page.lede()
4. Template Usage
The header code of the page we could do something like:
$meta_description = $page->meta_description()->or( $page->lede() );
统计信息
- 总下载量: 13
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2018-12-13