jordanbeattie/craftcms-block-styles

Neo blocks 的样式下拉菜单

1.0.0 2024-01-23 16:25 UTC

This package is auto-updated.

Last update: 2024-09-23 17:47:37 UTC


README

Neo blocks 的样式下拉菜单

要求

此插件需要 Craft CMS 4.5.0 或更高版本,以及 PHP 8.0.2 或更高版本。

安装

打开您的终端并运行以下命令

# go to the project directory
cd /path/to/my-project

# tell Composer to load the plugin
composer require jordanbeattie/craftcms-block-styles

# tell Craft to install the plugin
./craft plugin/install block-styles

使用

安装后,将在您的项目 config 目录中创建一个名为 block-styles.php 的文件。

只需将示例格式更新到此文件,以提供字段的下拉选项。

通过提供一个整数,下拉菜单将显示从 1 到您提供的整数之间的每个选项。例如,如果您输入 3,下拉菜单将显示 "one","two" 和 "three" 作为选项。或者,您可以提供每个块的选项数组,每个选项都有一个标签和值参数。

在 Craft 设置中创建一个字段,并选择 "Block Style" 选项,然后将其添加到您的 Neo blocks。