- This topic has 7 replies, 3 voices, and was last updated 2 years, 11 months ago by
David.
-
AuthorPosts
-
March 22, 2023 at 8:41 am #2577079
Aleksi
Hi,
thanks for GP and GB,
I would like to get help if possible for an overview on how to build an archive section with a filter. (see template in design file)
I’m using a free filter plugin (search and filter)
The point is to keep also the same layout after filtering.
So i thought of setting the same loop template for categories with the variables settings and hook location for each, but there’s an issue when selecting multiples categories, since it seems we cannnot set a custom url in hook location?
Should be possible to set that manually i think, or just adding a page and use a redirect?
Other than that, what is the best and quickest option for building this type of pages with a filter? Is is possible with GP premium + a filter plugin (free or premium), or use another premium plugin that have post layout and filtering like toolset?
Thanks also by the way for the Tab block, it came in very useful, as i was able to build with it that nice filter design.
March 22, 2023 at 9:45 am #2577207David
StaffCustomer SupportHi there,
what is the Custom URL requirement ?
As there is thegenerate_element_displayfilter for creating your own display conditions:https://docs.generatepress.com/article/generate_element_display/
For filter pages, a lot of users opt for FacetWP and hook that into the themes archives template.
Its super powerful but is only a paid version. If not then the Search and Filter you’re using is pretty good for most things.Appreciate the feedback and kind words on the tab block 🙂
March 22, 2023 at 11:03 am #2577367Aleksi
Thanks, that’s very helpful.
You can see the url when selecting for example category 1 and 2.
So what would be the exact code for this url in the condition part? (sorry i haven’t checked yet theses coding parts)
March 22, 2023 at 5:08 pm #2577806Fernando Customer Support
Hi Aleksi,
To clarify, can you give a couple of scenarios you want to occur?
For instance, when Category-1 is displayed, display Loop Template 1.
Then, when Category-1 + Category-2 is displayed, display Loop Template 2.
Is something like this what you’re going for?
March 23, 2023 at 5:33 am #2578591Aleksi
Hi Fernando,
thanks for your help,
basically, yes. When selecting category1+category2 it display the same loop but with category 1 and 2 selected in the query parameters.
I’m just looking for the exact code to select the page in the PHP code that David gave, i don’t have in mind all this right now.
March 23, 2023 at 9:14 am #2579041David
StaffCustomer SupportIf you use the Block Element Loop Template you can set the Display Rules to
All Archives
Add the GB Query Loop with NO parameters and check theInherit Query from TemplateSo this GB Query Loop will be display automatically on all archive pages.
Then when the Search and Filter is set eg. Category 1 and Category 2 it should simply rewrite the current archives query to include both those terms. And the GB Query Loop will inherit that query.
Does that make sense ?
March 23, 2023 at 2:31 pm #2579437Aleksi
Yes, this work.
Thank you very much.
March 24, 2023 at 3:17 am #2580060David
StaffCustomer SupportGlad to hear that
-
AuthorPosts
- You must be logged in to reply to this topic.