• Resolved pcarvalho

    (@pcarvalho)


    Hi!

    I have a page that needs two different sections:

    top section: gutenberg #1

    [ middle has html unrelated ]

    bottom section: gutenberg #2

    I found that to implement this i could use templates:

    [x] create a template with two sections ( top, bottom )
    [x] create a new block that suppors html ( this creates a gutenberg area )
    [ ] output each on different places

    my problem is that i don’t know how to save each gutenberg to different meta fields. Everything is saved to InnerBlocks.Content.

    Or is there other way to implement this?

    • This topic was modified 6 years, 3 months ago by pcarvalho.
    • This topic was modified 6 years, 3 months ago by pcarvalho.
Viewing 3 replies - 1 through 3 (of 3 total)
  • Moderator Marius L. J.

    (@clorith)

    Hi,

    It sounds like you’ve almost got the solution planned out already, that’s fantastic.

    I’m curious what you mean by the last “non-ticked” field, outputting it.

    If you create a template, you’ve defined that this custom html of yours is a fixed block that you put in there and the user can add their content above or below it. It sounds like that’s the full solution, is it not? You don’t need to split things up, it’s one piece of content to output.

    Thread Starter pcarvalho

    (@pcarvalho)

    Hi @clorith,

    yeah, almost done ??

    but i **do** want to split it ??

    been talking in our portuguese wp slack channel, and i got a suggestion to use gutenberg_parse_blocks() to parse the post_content*. Might work, i’ll try it, but if you have other suggestions, please, i’m all ears

    Moderator Marius L. J.

    (@clorith)

    If yo udo need to split it up, that sounds like a good approach, I was going to suggest just looking up something in the custom HTML that you know is unique and split it based on that with regular PHP functions (Take note that the function names that use gutenberg will change once in core, as we will not be calling things Gutenberg any more then, and it will just be the WordPress editor and we don’t want functions etc tied to a project codename ??

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Create multiple Gutenberg sections’ is closed to new replies.