- This topic has 10 replies, 3 voices, and was last updated 3 years, 3 months ago by
Fernando.
-
AuthorPosts
-
March 12, 2023 at 12:47 pm #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,
TomMarch 12, 2023 at 1:08 pm #2565218AMBTL
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.
March 12, 2023 at 5:08 pm #2565297Fernando 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
March 13, 2023 at 6:10 am #2565898AMBTL
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,
TomMarch 13, 2023 at 8:35 am #2566198AMBTL
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…
March 13, 2023 at 10:36 am #2566318David
StaffCustomer SupportHi there,
is it possible to see one of the pages with this issue ?
March 13, 2023 at 11:10 am #2566360AMBTL
Hello David,
Can I send an All-In-One Migration backup file so that you can freely experiment with it?
Greetings,
TomMarch 13, 2023 at 12:42 pm #2566428AMBTL
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…March 13, 2023 at 3:36 pm #2566567David
StaffCustomer SupportI just need to see the site. Is that possible ?
March 13, 2023 at 7:24 pm #2566672AMBTL
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,
TomMarch 13, 2023 at 10:13 pm #2566746Fernando 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
-
AuthorPosts
- You must be logged in to reply to this topic.