Create a composer.php file for the V9 Accordion block

My client wishes to use the Accordion block in the page composer. Is it straightforward to create the composer.php file to get the block to appear within composer? I have looked at the few examples available and I am struggling to see a general structure to it. I have looked at the tutorial but struggling to get my head around it?

Hi @studio108 so you’re looking at this? Enabling Composer Editing for a Block Type

Are there any other resources you’re looking at?

Accordions are going to be a trickier block than most to incorporate into composer just because they can be 1-n entries and you would need to be able to sort them, so your composer edit interface is going to have to be pretty robust, essentially as robust as the block edit form.

Thanks for the reply. I have looked at the core blocks that already work with Composer plus the tutorial in docs. I think I may just place the block on the page template output and suggest the client edits it directly on the newly created page.

1 Like

Yeah that’s probably a simpler and ultimately more effective solution. Accordions are pretty visual pieces so abstracting them out to composer might ultimately make it harder to see what they’re going to look like on the actual page, so users would end up in the block edit interface in any case.