jordanbeattie/craftcms-block-styles

Style dropdown for 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

Style dropdown for Neo blocks

Requirements

This plugin requires Craft CMS 4.5.0 or later, and PHP 8.0.2 or later.

Installation

Open your terminal and run the following commands:

# 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

Use

Upon install, a block-styles.php file will be created in your project's config directory.

Simply update this file with the example format to provide the dropdown options for your field.

By providing an integer, the dropdown will display an option for each option between 1 and your given integer. (e.g. if you input 3, the dropdown will show "one", "two" and "three" as options). Or you can provide an array of options per block, each with a label and value parameter.

Create a field in Craft settings and select the "Block Style" option and add it to your Neo blocks.