Log1x / acf-composer

Compose ACF Fields, Blocks, Widgets, and Option Pages with ACF Builder on Sage 10.
https://github.com/Log1x/acf-composer
MIT License
413 stars 56 forks source link

🧑‍💻 Improve template syntax handling (Fixes #239) #267

Closed Log1x closed 1 month ago

Log1x commented 1 month ago

The block $template property should now accept a wider range of sensible syntax which can be mix/matched as long as keys do not clash. For working with multiple blocks of the same type, simply wrap them in an array.

/**
 * The block template.
 *
 * @var array
 */
public $template = [
    'core/heading' => [
        'level' => 3,
        'placeholder' => 'Quick Tip:',
        'className' => 'text-2xl my-0 py-0',
    ],
    ['core/paragraph' => [
        'placeholder' => 'Lorem ipsum dolor sit amet, consectetur adipiscing elit.',
        'className' => 'py-0 mt-2 mb-0',
    ]],
    'core/separator',
    ['core/paragraph' => [
        'placeholder' => 'Duis aute irure dolor in reprehenderit in voluptate.',
        'className' => 'py-0 mt-2 mb-0',
    ]],
];