cbp/redactor-fa-list
Composer 安装命令:
composer require cbp/redactor-fa-list
包简介
Adds a way to add font awesome icons as list markers in Redactor.
关键字:
README 文档
README
Redactor Font Awesome List
This redactor plugin allows you to add Font Awesome icons as markers for your redactor lists.
Will generate HTML through a simple icon picker:
<ul class="fa-ul"> <li><span class="fa-li"><i class="fas fa-check"></i></span> List item 1</li> <li><span class="fa-li"><i class="fas fa-check"></i></span> List item 2</li> <li><span class="fa-li"><i class="fas fa-times"></i></span> List item 3</li> </ul>
See Font Awesome's Icons in a List.
Requirements
This plugin requires Craft CMS 3.1 or later as well as the Craft Redactor plugin v2.0 or later.
Installation
Install through the Plugin Store.
Alternatively, you can download and install this plugin with Composer.
Open your terminal and run the following commands:
# go to the project directory cd /path/to/my-project # tell Composer to load the plugin composer require cbp/redactor-fa-list # tell Craft to install the plugin ./craft plugin/install redactor-fa-list
Adding to your Redactor fields
Include the plugin in your Redactor config file located in config/redactor/Default.json. To do so, add "falist" in the plugins array:
{
"buttons": ["html"],
"plugins": ["fullscreen", "falist"]
}
NOTE: Don't forget to include Font Awesome on your front-end.
Allow Certain Icons and Styles
By default, over 1000 Font Awesome icons are available to be selected from within the field. If you want to limit which icons your authors can select, you can override the setting value.
Create a new file config/redactor-fa-list.php:
return [ 'icons' => [ "heart", "star" ] ];
If only a string is provided (as above), it will default to the Solid (.fas) styling. To specify styled icons, use a key => value pair:
return [ 'icons' => [ ["heart" => "fal"], // this will be the Light style ["heart" => "fad"], // this will be the Duotone style "star", // this defaults to Solid style ["creative-commons" => "fab"] // this will be the Brands style ] ];
Specify Versions
Since, by default, only free Solid styles are assumed, the Font Awesome CSS webfont is loaded to display icons in the redactor field automatically. If you choose to use other icon styles or target a specific version of FA, you need to include the proper CSS file(s) in your settings override:
//Using Webfont CDN use craft\helpers\App; return [ 'icons' => [ ["alien" => "fad"], ["creative-commons" => "fab"] ], 'styles' => [ [ 'src' => "https://pro.fontawesome.com/releases/v5.15.3/css/all.css", 'params' => [ 'integrity' => App::env('FA_INTEGRITY'), 'crossorigin' => "anonymous" ] ], 'https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.3/css/brands.min.css' ] ];
NOTE: Currently there are too many bugs with using FA Kits with the redactor fields, so support was removed in v1.0.4 of this plugin. However, just because you use the webfont CDN on the backend doesn't mean you can't use the FA Kit script for your frontend :)
cbp/redactor-fa-list 适用场景与选型建议
cbp/redactor-fa-list 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 1.42k 次下载、GitHub Stars 达 0, 最近一次更新时间为 2020 年 10 月 21 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「list」 「Redactor」 「icon」 「font awesome」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 cbp/redactor-fa-list 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 cbp/redactor-fa-list 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 cbp/redactor-fa-list 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Easily provide front-end sorting controls for SilverStripe lists
PHP Library to get the apple-touch-icons and favicon from a website.
Allows you to easily use Craft Globals as variables in Rich Text fields
A block to display a list of links to child pages, or pages in current level
Adjacency List’ed Closure Table database design pattern implementation for Laravel. Includes restore of tree
Icon support for Silverstripe taxonomy terms
统计信息
- 总下载量: 1.42k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 12
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2020-10-21