[Resolved] Is adding an element to gutenberg blocks possible?

Home Forums Support [Resolved] Is adding an element to gutenberg blocks possible?

Home Forums Support Is adding an element to gutenberg blocks possible?

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #1037862
    Purushottam

    I would like to create reusable elements and then use them as gutenberg block. Is this planned or in the roadmap? I know, elements are already reusable. The current limitation I am facing is, I need to place the element at a specific location in a blog post (other than hook locations) and while the structure would be the same, the content would be different for each post.
    What would be the best way forward with this?
    1. Create custom repeater field and display using a custom created hook
    2. Use a plugin that enables creating custom gutenberg blocks using ACF?

    Is there another/better solution?

    #1037992
    David
    Staff
    Customer Support

    Hi there,

    we have some future plans for a block element module but this is a way off. And wouldn’t do this – it would just allow you to hook content that is created using the Block Editor.
    How would this block be populated with the dynamic content?

    The simplest method is to just create your Block, save it as a Reusable Block and then add it to each post, convert to regular block and edit the content….

    #1038355
    Purushottam

    “it would just allow you to hook content that is created using the Block Editor.”
    How would this block be populated with the dynamic content?

    Using ACF repeater field and a simple php echo loop would do if the ability to hook an element is here in the future. So each post would have different repeater entries and the php script would output different values for each post. I am so excited that this is planned! What I am dreaming doing with this:

    1. Creating elements that look same but have different text/urls. Eg. CTA on post A could point to a different url than Post B
    2. Comparison tables
    3. Table of Contents
    4. Completely eliminate page builders?

    It is a humble request to the GeneratePress team to move this or prioritise ( if at all possible)!

    #1038366
    David
    Staff
    Customer Support

    Although some dynamic content may be possible – like the template tags you find in the Header Element, we’re not looking to replicate what ACF does.

    The first stage will be the release of our own block plugin.
    Depending on how Gutenberg progresses with Content Areas we will revisit the option to hook content.

    #1038373
    Purushottam

    “Although some dynamic content may be possible – like the template tags you find in the Header Element,” Yes, but elements also allow php, so using acf fields won’t be an issue.
    “we’re not looking to replicate what ACF does.” Absolutely.

    “The first stage will be the release of our own block plugin.
    Depending on how Gutenberg progresses with Content Areas we will revisit the option to hook content.”
    Great!

    I will mark the topic resolved! thanks!

    #1038375
    David
    Staff
    Customer Support

    You’re welcome

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