bobbingwide / oik-shortcodes

Shortcode, block and API server
https://www.oik-plugins.com/oik-plugins/oik-shortcode-server/
GNU General Public License v2.0
1 stars 0 forks source link

[blocks] shortcode - extend to support links to block variations #85

Closed bobbingwide closed 2 years ago

bobbingwide commented 2 years ago

The oik-block/blockinfo and oik-block/blocklist blocks from the oik-blocks plugin both support links to block variations but the [blocks] shortcode does not.
Both of these blocks create links to all the block's variations.

I need a way to refer to an individual block variation, such as the Post Tags variation of the Post Terms block.

Requirement

To be able to create inline links to blocks which are implemented as variations.

Proposed solution

The syntax of the variation would be prefix/block-name:variation-name

eg core/post-terms:post-tags for Post Tags and core/post-terms:post-categories for Post Categories

On detecting the colon in the block name the shortcode would first look for the block, then for the variation. Use the oiksc_get_block() function.

bobbingwide commented 2 years ago

Delivered in v1.41.0.