shel/neos-image-checker

此包最新版本(1.1.2)没有提供许可证信息。

Neos CMS的自定义检查图像编辑器

资助包维护!
Patreon
sebobo

安装: 1,901

依赖者: 0

建议者: 0

安全: 0

星标: 10

观察者: 2

分支: 1

公开问题: 0

语言: TypeScript

类型: neos-plugin

1.1.2 2022-11-18 08:52 UTC

This package is auto-updated.

Last update: 2024-09-12 18:16:18 UTC


README

Tests

此包提供Neos CMS插件,扩展默认Neos图像编辑器,为所选图像添加额外检查。它支持对每种图像类型的全局和单个配置。

安装

将插件添加为Neos CMS项目的依赖项

composer require shel/neos-image-checker

示例

所有检查都通过示例

Example with passed checks

注意:默认情况下不显示详细信息,可以通过点击“i”按钮切换。

某些检查失败示例

Example with failed checks

注意:默认情况下显示此处的详细信息,可以通过点击“警报”按钮切换。

配置

安装后,您的Neos安装中的默认图像编辑器将替换为此包中的编辑器。附加功能仅封装提供的Neos图像编辑器,因此它不包含编辑器的代码,在大多数情况下支持无需更新此插件即可更新Neos UI。

全局设置

每个图像编辑器的全局默认值

Neos:
  Neos:
    Ui:
     frontendConfiguration:
      'Shel.Neos.ImageChecker:ImageChecker':
        enabled: true # allows disabling the checks for all image properties
        defaults:
          fileSize:
            default: 2048
            svg: null
            png: null
            jpg: null
          fileDimensions:
            maxWidth: null
            maxHeight: null
            minWidth: null
            minHeight: null
          fileName:
            allowedPattern: '^[0-9a-zA-Z_\-.]+$'

单个设置

对于nodetype的每个图像属性,您可以覆盖以下设置的单个或全部

My.Vendor:My.NodeType:
  properties:
    image:
      type: 'Neos\Media\Domain\Model\ImageInterface'
      ui:
        label: 'Some image'
        reloadIfChanged: true
        inspector:
          group: image
          editorOptions:
            features:
              imageCheck: # optional overrides
                fileSize: # in kb
                  default: 2048 # optional
                  svg: 100 # optional
                  jpg: 2048 # optional
                  png: 2048 # optional
                fileDimensions: # in px, only affects jpg and pngs
                  maxWidth: 500
                  maxHeight: 300
                fileName: # matches the filename without extension
                  allowedPattern: '^[a-z]+$'

许可证

许可证