承接 cbp/redactor-fa-list 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

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 icon

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 :)

统计信息

  • 总下载量: 1.42k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2020-10-21

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固