[solved] How to add core/buttons with core/button as a Block Inner Content Template?

I’d like to add a Group of Buttons core/buttons to an Inner Block template but can’t get it to work.
I have to add CSS Classes to the inner core/button so it’s not enought just to add core/buttons without the specific buttons.

This is not working:

[
['${this}/section-intro1',{}],
['core/paragraph', {}],
['core/buttons', {['core/button', { 'className' : 'btn\u002d\u002dprimary btn\u002d\u002doutline' } ]}]
]

To add a Group of Buttons core/buttons to an Inner Block template with specific CSS classes for each button, you need to ensure you’re defining the core/button blocks within the core/buttons block correctly in your template. Here’s a basic example:
{
“name”: “my-template”,
“title”: “My Template”,
“innerBlocks”: [
[“core/buttons”, {}, [
[“core/button”, { “className”: “my-custom-class-1” }],
[“core/button”, { “className”: “my-custom-class-2” }]
]]
]
}

Ensure each core/button has the appropriate CSS class in the attributes. Adjust the class names as needed for your specific use case.
I hope it will helps you :dizzy:

3 Likes

Thank you, this is working.

2 Likes