[Resolved] Building Elements with GenerateBlocks

Home Forums Support Building Elements with GenerateBlocks

Viewing 9 posts - 1 through 9 (of 9 total)
  • Author
    Posts
  • #1292790
    Paul

    Been playing around with GenerateBlocks recently and wanted to see if it would be possible to create an Elements Page Header by building the header content and layout using GenerateBlocks in a brand new page (such as a full-width container with background image, and a two column grid with a headline and some text in the left column, and a contact form 7 form in the right column), then viewing the page in Code View to copy the GenerateBlocks code, and then pasting that into the page header’s content area.

    Now, when I assign that page header to the page I just built with GenerateBlocks, everything looks fine.

    But if I assign the page header to another page or post, the CSS doesn’t carry over, so much of the CSS styling is lost, although the heading, text and CF7 form do appear.

    Why is this? Does it have to do with the uniqueID that GB assigns to each block element? Is there anything I can modify in the code generated by GenerateBlocks so I can use the blocks code globally (such as by pasting it into elements or into other pages for example)?

    What I’m trying to achieve is similar to Elementor’s Template Library. And I don’t see a way to add Reusable Blocks to Elements which would seem to be the best way to go about this (maybe via shortcode).

    I know this is a feature Tom has planned for GPP 1.11 (can’t wait for that!), but wanted to know if there were any work-arounds in the meantime and to share my experience so far.

    #1292878
    Leo
    Staff
    Customer Support

    Hi there,

    Not sure if I understand this completely but I wouldn’t copy the HTML code of GenerateBlock into the header element content tab.

    The better solution would be to build the header element as the content of the page using GB.

    Does that help?

    We will actually be doing this in the site library from now on.

    #1292938
    Paul

    Hi Leo,

    Yes, that’s the way I guess it has to be done now, but it sure will be nice once we can build Elements using re-usable GB blocks so that these GB-based elements can be quickly inserted into multiple pages and edited in one place globally rather than on a page-by-page basis.

    Just something I wanted to experiment with to see if it was currently possible.

    #1292978
    Leo
    Staff
    Customer Support

    Ahh yes I got your point now 🙂

    #1476808
    Osman

    Hi,
    I d like to jump in here, if I may and ask a question on this topic.
    I am using the Merch theme and would like to add a “global container/block”-element to all my posts in my blog. Is this possible by now or not?
    Basically, just a line of text/signature, that might change in the future. If so, I d then simply change the content of that “global container/block”-element, so that it displays the change in all my blog-posts, where I ve implemented it.
    Thanks

    #1476853
    David
    Staff
    Customer Support

    Hi there,

    yes of course – you can use the Block Element:

    https://docs.generatepress.com/article/block-element-overview/

    It has all the Hooks available in the Hook Element 🙂

    #1476939
    Paul

    The question in my OP can essentially be ignored now since the type of functionality I asked about is now available in the latest version of GP Premium Elements. As always, the GP Team never fails to impress with their constant innovation and feature development. Keep up the great work guys & gals!

    #1476947
    Osman

    Great! However, I was hoping to select that particular Element and randomly add it within the (Generate)Block-editor, when generating content. With the hooks provided, I can’t place them where I want (before the footnotes, which vary).


    @Paul
    : I haven t updated to GP 3.0, yet. Will update and check again.

    Thank you all very much anyways

    #1477024
    David
    Staff
    Customer Support

    Thanks Paul – really appreciate the feedback.

    Osman, Hooks only access areas within the Theme templates. If you’re trying to insert them inside the content then thats not possible. You would have to save a Re-usable block and insert that in the post editor.

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