[Resolved] Block Element in Sidebar

Home Forums Support [Resolved] Block Element in Sidebar

Home Forums Support Block Element in Sidebar

Viewing 15 posts - 1 through 15 (of 25 total)
  • Author
    Posts
  • #1662362
    Ian

    Am I missing something. I created a Block Element of social icons using GB Buttons. Is there a way to grab this as a shortcode and inject it into the default WP sidebar?

    #1662365
    Ying
    Staff
    Customer Support

    Hi Ian,

    You could choose hook as block type, choose generate_before_sidebar or generate_after_sidebar as hook. Here’s a visual guide for GP hooks.

    Hope it helps πŸ™‚

    #1662368
    Ian

    Thanks Ying. The Social Icons need to be the 2nd widget in the sidebar. Is there any other way to do this?

    Also, I was hoping to use GB to build out the icons. I think I may be missing something here. Given the great tools like Blocks and Elements, it seems to be doable. lol

    #1662373
    Ying
    Staff
    Customer Support

    Yes, could use some CSS to re-order the widgets in sidebar πŸ™‚

    Please link us to the site in question using the private info field so we can have a look.

    #1662376
    Ian

    Thank you. I have added a link to a post. You can see the social icons right now. I want to replace this using GB Buttons.

    #1662408
    Ying
    Staff
    Customer Support

    Alright, set block element using generate_before_right_sidebar hook, and here’s the CSS to position the sidebar content:

    .inside-right-sidebar {
        display: flex;
        flex-direction: column;
    }
    .inside-right-sidebar #search-8 {
        order: -1;
    }
    #1662410
    Ian

    Hi Ying,

    If I am using Blocks (GB Buttons module) to make these icons, how can I hook it? There is no hook function within Element > Blocks Element. Again, I may be missing something here.

    Come to think of it, since Blocks is a thing now, I wonder if we can use GB to build the entire sidebar and insert it this way?

    #1662425
    Ying
    Staff
    Customer Support

    First option use block element as a hook:

    1. Choose hook as block type:
    https://docs.generatepress.com/article/block-element-overview/#block-type

    2. Choose generate_before_right_sidebar as hook.

    3. Add CSS to customizer > additional css.

    Second option, yes, you can build the entire sidebar using blocks. Just choose right sidebar as block type, it will replace the default sidebar you are having now.
    https://docs.generatepress.com/article/block-element-overview/#right-sidebar-type

    Let me know πŸ™‚

    #1662437
    Ian

    When I choose Element = Hook, there is no way to launch Gutenberg to use Generate Blocks to build the icons using GB Buttons?

    #1662439
    Ying
    Staff
    Customer Support

    Well all the steps are based on it’s a Block element, not Hook element or Header element or any other elements. πŸ˜›

    So before all the steps I mentioned in my previous reply, you go to Appearance > Elements, Create a Block element.
    https://docs.generatepress.com/article/block-element-overview/#creating-a-block-element

    #1662445
    Ian

    Wait, I see the issue now. This site is still running the Classic Editors so we have installed a plugin to be able to switch Between Classic and Block Editor. When choosing Block, I see Block Type in the classic Editor. But once I switch to Block Editor, the Block Type options disappear even if I switch back to the Classic Editor. Glitch?

    #1662450
    Ying
    Staff
    Customer Support

    Any chance you can link us the login info?

    You can use the private information field.

    #1662452
    Ian

    Hi Ying, done. Let me know what else I can provide!

    #1662459
    Ying
    Staff
    Customer Support

    I just had a look, got what you were struggling with.

    Once you deactivate classic editor plugin, you can add a new Block element with all the settings available πŸ™‚

    #1662462
    Ian

    Doh! Site has a long history, not ready to deactivate that yet. May I ask if you deactivated that plugin when you logged in?

    If so, do you think all old content will stay as is until someone edits with Block editor and choose Convert to Blocks? We have some very old content that rocks so don’t want to break anything.

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