JavaScript for WordPress Forums Gutenberg Development Extending on the topic of the Custom Toolbar example.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #54795
    aelonrench
    Participant

    I’d love to build on this. And perhaps study a core-element block such as the WP-core Heading block, and see how they had constructed a toolbar that configures the h-‘size’ tag / element being used. It appears the blocks have been relocated (possibly into a NPM package?) . Can somebody tell me how I can access the index.js of the header block of the core library?

    Many thanks!

    #54811
    Zac Gordon
    Keymaster

    Here is the current location of the core blocks 🙂

    https://github.com/WordPress/gutenberg/tree/master/packages/block-library/src

    #55619
    aelonrench
    Participant

    Has anybody been able to import an existing block-library component into a custom block being developed?
    What I’m trying to do is import existing structure of the Heading block inside a larger “container / rich text block”. I could start building custom block – field buttons, but I see this getting hairy quick.

    It’s possible I’m searching the web but not using the right vernacular.

    #55640
    Zac Gordon
    Keymaster

    My understanding is core blocks are not meant to be imported into custom blocks.

    But you can look at how that core block was built and rebuild it in your block.

    If you want to group together blocks, you might want to use reusable blocks or block templates or even nested blocks. The nested blocks approach might work.

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.