slides icon indicating copy to clipboard operation
slides copied to clipboard

Should it be possible to insert a slide block into a slide block?

Open bobbingwide opened this issue 6 years ago • 3 comments

I created a new presentation slide and inserted a Slide block into the existing slide. Should I have been prevented from doing so?

<!-- wp:slide/slide -->
<section class="wp-block-slide-slide"><!-- wp:heading {"level":1} -->
<h1>Slide without slide</h1>
<!-- /wp:heading -->

<!-- wp:slide/slide -->
<section class="wp-block-slide-slide"><!-- wp:paragraph -->
<p>Slide within Slide</p>
<!-- /wp:paragraph --></section>
<!-- /wp:slide/slide --></section>
<!-- /wp:slide/slide -->

bobbingwide avatar Nov 05 '19 11:11 bobbingwide

BTW: I was being particularly dumb when I did this. At the time I hadn't actually realised how to create a slide show. I had created multiple presentations with one slide per CPT. It was not obvious to me that I needed to use the Slide block multiple times inside a presentation.

bobbingwide avatar Nov 05 '19 11:11 bobbingwide

That should not be possible indeed. There's currently no API in the block editor to prevent certain blocks inside a particular block, but I'll find a way around it. :)

ellatrix avatar Nov 06 '19 12:11 ellatrix

Will you have to get a list of allowedBlocks and remove yours?
Or is it time for a PR for disallowedBlocks? https://github.com/WordPress/gutenberg/issues/7845#

bobbingwide avatar Nov 06 '19 12:11 bobbingwide