Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

πŸ§‘β€πŸ’» Improve template syntax handling (Fixes #239) #267

Merged
merged 1 commit into from
Jul 16, 2024

Conversation

Log1x
Copy link
Owner

@Log1x Log1x commented Jul 16, 2024

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',
    ]],
];

@Log1x Log1x merged commit 6f26046 into master Jul 16, 2024
2 checks passed
@Log1x Log1x deleted the fix/239 branch July 17, 2024 03:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant