carbon/previewmodebutton

在Neos CMS后端通过按钮切换预览模式

安装: 216

依赖: 1

建议者: 0

安全: 0

星星: 0

监视者: 1

分支: 0

开放问题: 0

语言:JavaScript

类型:neos-carbon

0.1.0 2024-04-11 20:11 UTC

This package is auto-updated.

Last update: 2024-09-07 08:13:03 UTC


README

Latest stable version Total downloads License GitHub forks GitHub stars GitHub watchers

Carbon.PreviewModeButton

在Neos CMS后端通过按钮切换预览模式。

安装

Carbon.PreviewModeButton 通过packagist提供。在您的站点包中运行以下命令:

composer require --no-update carbon/previewmodebutton

然后在项目根目录中运行 composer update

配置

要将按钮添加到面板,请添加如下配置:

Neos:
  Neos:
    Ui:
      frontendConfiguration:
        "Carbon.PreviewMode:Button":
          # If you set a view mode to true, it will fallback to Neos.Neos:Document and will have no custom icon or label
          rawContent: true

          # The name of the preview mode
          teaserView:
            # If a document is this node type or has this supertype, show the button. Otherwise it will be hidden
            # Defaults to 'Neos.Neos:Document'
            nodeTypeName: "Foo.Bar:Mixin.TeaserDocument"
            # Set the icon. Defaults to 'fas fa-pencil'
            icon: "fas fa-images"
            # Add `aria-label` and `title` to the button. Will be translated, but can also be a plain text
            label: "Foo.Bar:Backend.Main:editPreviewModes.teaserView"
            # Sets the position. Defaults to 'start'
            position: "start 1"