Site logo

[Support request] get_sidebar() with Block Elements (sidebar type)

Home Forums Support [Support request] get_sidebar() with Block Elements (sidebar type)

Home Forums Support get_sidebar() with Block Elements (sidebar type)

Viewing 11 posts - 1 through 11 (of 11 total)
  • Author
    Posts
  • #2565200
    AMBTL

    Hi,

    I am building a site with GP, Meta Box and FacetWP.
    In the conditional sidebars I need filters generated by FacetWP.

    To create the loops I use Meta Box Views, and to make it work in Taxonomy Archives, I must choose “Replace the layout between header and footer” from the View settings. This, however, deletes the sidebar.

    I have found out that adding the get_sidebar() function (as Meta Box proxy {{ mb.get_sidebar() }} ) to the template, adds the sidebar. But that only adds the default sidebar. The Display settings in the Block Element are not respected, Meta Box Views doesn’t “see” the Block Element.

    Are the sidebars created with Block Elements registered as proper sidebars, so that I could try get_sidebar(‘my-sidebar-id’)? I looked for them in the database, but could not find them.
    Or maybe there is some trick to force them to display them where needed?

    Greetings,
    Tom

    #2565218
    AMBTL

    Update: Something unexpected happened: I changed the Element settings to “right sidebar” and the block element appeared in the left sidebar… My layout is Sidebar/Content, so I am a little confused…

    The body class is “.left-sidebar” and the widget area class is “.is-right-sidebar”. I am glad it seems to work, but I am quite confused about what is happening.

    #2565297
    Fernando
    Customer Support

    Hello there,

    That’s odd indeed. Did you make any changes to the template files? Do all the sidebar hooks behave differently?

    Reference: https://docs.generatepress.com/article/hooks-visual-guide/#posts-page

    #2565898
    AMBTL

    No, I didn’t touch any GeneratePress template files. And yes, it doesn’t matter if I replace the sidebar completely in Elements, or place it “after_right_sidebar_content”. Basically, right is the new left 🙂

    I only created a Meta Box Views template for the taxonomy archive, using Twig. And added the sidebar through “get_sidebar()”, because it won’t appear otherwise.

    Do Elements sidebars have names/IDs which could be accessed through get_sidebar()?

    Greetings,
    Tom

    #2566198
    AMBTL

    Update: Unfortunately, even accepting that “right is the new left” doesn’t work, because the element display conditions don’t work. I have so far 1 sidebar for taxonomy term archive 1 and another sidebar for taxonomy term 2. The second sidebar should completely replace the sidebar (Element Type: right sidebar), but what it does is it merges with first sidebar, as if it were “after right sidebar content”. So, it is not usable, the way it is now…

    #2566318
    David
    Staff
    Customer Support

    Hi there,

    is it possible to see one of the pages with this issue ?

    #2566360
    AMBTL

    Hello David,

    Can I send an All-In-One Migration backup file so that you can freely experiment with it?

    Greetings,
    Tom

    #2566428
    AMBTL

    Update: the sidebars no longer merge, it turned out the display condition wasn’t saved correctly.
    But still, the sidebars are not displayed in the right place. And I cannot have a dual sidebar setup. Changing the layout to Sidebar/Content/Sidebar enables only the Right Sidebar area, and the Left Sidebar area is not there in the page source, although the body class is “both sidebars”. I would like to have 2 sidebars on some archives…

    #2566567
    David
    Staff
    Customer Support

    I just need to see the site. Is that possible ?

    #2566672
    AMBTL

    The link is in the private information below. The site is under construction and might not work well on small screens at the moment. I recommend viewing on a larger monitor.

    Greetings,
    Tom

    #2566746
    Fernando
    Customer Support

    Can you provide admin login credentials so we can take a closer look?

    Please use the Private Information field for this: https://docs.generatepress.com/article/using-the-premium-support-forum/#private-information

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