• Resolved mayy3321

    (@mayy3321)


    It says you supply a block. How do you use it in Gutenberg editor?
    I can’t seem to find it.

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Paul Ryan

    (@figureone)

    The block should just be called “Insert Page”; but you may have to enable it in settings:
    WordPress Dashboard > Settings > Insert Pages > Enable Insert Pages Gutenberg block.

    • This reply was modified 2 years, 8 months ago by Paul Ryan.
    Thread Starter mayy3321

    (@mayy3321)

    Thanks found it. Is there any advantage using block vs shortcode block?
    In terms of reusing this in many pages/posts.

    Plugin Author Paul Ryan

    (@figureone)

    Not really, I think it comes down to your preference. The same php code renders the inserted page regardless of whether it’s a gutenberg block or a shortcode.

    They appear slightly different in the database, but no end user is going to see that. In wp_posts.post_content, the gutenberg block appears as:
    <!-- wp:insert-pages/block {"url":"https://example.com/hello-world/","page":1} /-->
    and the block is
    [insert page='hello-world']

    Thread Starter mayy3321

    (@mayy3321)

    Hmm [insert page=’hello-world’] feels safer. What if I change the url, but not the page in the gutenberg block? It is strange.

    I wonder, if I put in insert page into many posts, and this page contains a recent posts block, will each post use one cached insert page item, or will the recent posts block regenerate each time in the new post?

    Plugin Author Paul Ryan

    (@figureone)

    I prefer the shortcode too (that was the original API when the plugin was first released). But even though gutenberg is changing because it’s not as mature, it is the way WordPress is heading for the future. Both should be supported for the foreseeable future though!

    Re: WordPress caching, I think gutenberg has a cache layer somewhere but I don’t know the specifics. I do know that all database queries are cached, so at least there shouldn’t be duplicate queries to get the post data.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Gutenberg block use?’ is closed to new replies.