bobbingwide / oik-blocks

WordPress 5.0 blocks for oik shortcodes
https://oik-plugins.com/oik-plugins/oik-blocks
GNU General Public License v3.0
1 stars 0 forks source link

Default rendered content for Dynamic content block is [] - shortcode not selected.... #36

Open bobbingwide opened 4 years ago

bobbingwide commented 4 years ago

When the Dynamic content block is first displayed, very few of the attributes are set. The server side rendering is invoked but the shortcode attribute is not set. The result is '[]'.

How can this be improved? See #34

bobbingwide commented 3 years ago

I believe the oik-block/shortcode-block suffers from the same problem.

bobbingwide commented 3 years ago

In oik-blocks the workaround was to check the result of the shortcode expansion if it was [] then it replaces it with "Select a Display type". See shortcodes/oik-content.php -

if ( '<span>&#91;</span>]' === $result ) {
        $result="<!-- No result for shortcode $shortcode -->";
        $result.= '<p>Select a Display type</p>';
    }
bobbingwide commented 3 years ago

I should either raise a separate issue for the oik/shortcode-block or repurpose this issue.

bobbingwide commented 2 years ago

I should either raise a separate issue for the oik/shortcode-block or repurpose this issue.

At present, once the Select a Display type message is displayed, in order to choose the first item, another needs to be selected.
Therefore, before doing this the solution should