by/first-image
Composer 安装命令:
composer require by/first-image
包简介
A plugin to get first image from Redactor Field.
README 文档
README
A plugin to get first image from Redactor Field.
Requirements
This plugin requires Craft CMS 3.0.0 or later.
Installation
To install the plugin, follow these instructions.
-
Open your terminal and go to your Craft project:
cd /path/to/project -
Then tell Composer to load the plugin:
composer require by/first-image -
In the Control Panel, go to Settings → Plugins and click the “Install” button for First Image.
Using First Image
There are two ways of getting first image from a redactor field:
{{ entry.body | getFirstImage }}
or
{% set image = getFirstImage(entry.body) %}
This will output the source of the first image found, which then can be used in <img> tag.
Brought to you by Bhashkar Yadav
统计信息
- 总下载量: 1.14k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 4
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2018-08-20