Site logo

[Resolved] Help with an archive section with filter

Home Forums Support [Resolved] Help with an archive section with filter

Home Forums Support Help with an archive section with filter

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #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.

    #2577207
    David
    Staff
    Customer Support

    Hi there,

    what is the Custom URL requirement ?
    As there is the generate_element_display filter 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 🙂

    #2577367
    Aleksi

    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)

    #2577806
    Fernando
    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?

    #2578591
    Aleksi

    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.

    #2579041
    David
    Staff
    Customer Support

    If 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 the Inherit Query from Template

    So 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 ?

    #2579437
    Aleksi

    Yes, this work.

    Thank you very much.

    #2580060
    David
    Staff
    Customer Support

    Glad to hear that

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