定制 rias/statamic-color-swatches 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

rias/statamic-color-swatches

最新稳定版本:2.3.1

Composer 安装命令:

composer require rias/statamic-color-swatches

包简介

README 文档

README

Icon

Latest Version

Color Swatches

Color Swatches for Statamic >= v3.

For the Statamic 2 version, check out the v1 branch

Let clients choose from a predefined set of colors.

Screenshot

License

Color Swatches requires a license to be used while on a production site.
You can purchase one at https://statamic.com/marketplace/addons/color-swatches.

You may use Color Swatches without a license while Statamic is in Trial mode.

Installation

Require it using Composer.

composer require rias/statamic-color-swatches

Publish the assets:

php artisan vendor:publish --provider="Rias\ColorSwatches\ServiceProvider"

Color Swatches Overview

Instead of providing a user a full color picker, Color Swatches gives an admin the ability to provide a selection of colors for a user to choose from.

Using Color Swatches

Add the fieldtype to your fieldset, you can define multiple colors for a swatch by using a YAML array. You can also set a default color by entering the label.

sections:
  main:
    display: Main
    fields:
      -
        handle: color
        field:
          type: color_swatches
          display: Color
          colors:
            -
              label: red
              value:
                - '#F56565'
            -
              label: orange
              value:
                - '#ED8936'
            -
              label: green
              value:
                - '#48BB78'
            -
              label: blue_yellow
              value:
                - '#4299E1'
                - '#E7C961'

Using Color Swatches

You can access both the label and color in your template.

{{ color.label }}
{{ color.value }}
{{ color.value.0 }} #If it's more than one color

Brought to you by Rias

统计信息

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

GitHub 信息

  • Stars: 16
  • Watchers: 2
  • Forks: 2
  • 开发语言: PHP

其他信息

  • 授权协议: Unknown
  • 更新时间: 2019-12-06