dolphiq/iconpicker
最新稳定版本:1.0.5
Composer 安装命令:
composer require dolphiq/iconpicker
包简介
Craft Iconpicker field type that offers end-users an easy way to pick an icon/symbol from a .woff or .ttf font file.
README 文档
README
Currently the project is DISCONTINUED. However, feel free to fork it and continue its development!
Craft plugin that provides a new field type that offers users an easy way to pick an icon from a .woff or .ttf font file. You can easily use ionicons or font awesome icons
Note: This plugin may become a paid add-on when the Craft Plugin store becomes available.
Requirements
- Craft 3.0 (beta 20)+
- PHP 7.0+
- PhenX PHP Font Lib
- One or more .ttf or .woff files
Example
Example of the field usage in the template for a cms user
Example of the selection popup
Installation
-
Install with Composer
composer require dolphiq/iconpicker -
Install plugin in the Craft Control Panel under Settings > Plugins
-
Add the plugin assets to your application by adding the following line at the begin of your template:
{% do view.registerAssetBundle("plugins\\dolphiq\\iconpicker\\assets\\sharedAsset") %} -
Add the fonts you want to the following directory
/vendor/dolphiq/iconpicker/src/resources-shared/fonts -
The
Iconpicker Fieldtype will be available when adding a new field - Settings > Fields > Add new field
Creating a field with the iconpicker field type
- Choose the
Iconpicker Fieldtype - When adding a new field with the
Iconpicker Fieldtype, you can choose which font you want to use for that field from the dropdown
Using the iconpicker field type
- Add the field to a field layout (for example to a section)
- You can now choose an icon when creating or updating a section
Usage sample in twig template
Quick example code
{% do view.registerAssetBundle("plugins\\dolphiq\\iconpicker\\assets\\sharedAsset") %}
<html style="padding: 0; margin: 0;">
<head>
<title></title>
{{ head() }}
</head>
<body>
{{ beginBody() }}
{% if entry.iconPickerField.icon %}
Hex: {{ entry.iconPickerField.icon }}<br>
{{ entry.iconPickerField.iconSpan|raw }}
{% endif %}
{{ endBody() }}
</body>
</html>
Display an icon with a custom class:
<span class='{{ entry.iconClass }} myCustomClass'>{{ entry.iconChar }}</span>
Properties of the icon field
-
Get the icon unicode (decimal)
{{ entry.fieldName.icon }} -
Get the icon unicode (hexadecimal)
{{ entry.fieldName.iconHex }} -
Display the icon as html character
�{{ entry.fieldName.iconChar|raw }} -
Display the icon as html character hex
{{ entry.fieldName.iconCharHex|raw }} -
Display the icon as span with character and font class
{{ entry.fieldName.iconSpan|raw }} -
Get the icon font class
{{ entry.fieldName.iconClass }} -
Conditional example of showing icon only when it is set
{% if entry.fieldName.icon %} {{ entry.fieldName.iconSpan|raw }} {% endif %}
Iconpicker Roadmap
- Select and upload the fonts in the UI
- Enable (name) search while picking an icon
Contributors & Developers
Lucas Weijers - Original developer Johan Zandstra - Minor changes Brought to you by Dolphiq info@dolphiq.nl
dolphiq/iconpicker 适用场景与选型建议
dolphiq/iconpicker 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 13.99k 次下载、GitHub Stars 达 16, 最近一次更新时间为 2017 年 09 月 06 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「cms」 「icon」 「Craft」 「symbol」 「craftcms」 「iconpicker」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 dolphiq/iconpicker 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 dolphiq/iconpicker 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 dolphiq/iconpicker 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Expand, collapse, change the status of, or delete multiple blocks in a Matrix field simultaneously.
PHP Library to get the apple-touch-icons and favicon from a website.
GraphQL authentication for your headless Craft CMS applications.
Set Links with a specific language parameter
Supercharged text field validation.
Icon support for Silverstripe taxonomy terms
统计信息
- 总下载量: 13.99k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 16
- 点击次数: 30
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2017-09-06