Skip Navigation

[Resolved] Possible to get filters as in the example?

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Hong_Kong (GMT+08:00)

This topic contains 16 replies, has 3 voices.

Last updated by simonV-3 1 year, 6 months ago.

Assisted by: Luo Yang.

Author
Posts
#2598289
overview with other filters button.png
filters to selct.png

Tell us what you are trying to do? We like to achieve a similar website as hidden link

By click on "Filters" - the user is able to click on different filters. Is this possible to do in a view?

We are using the "legacy" version of views - so not Gutenberg version.

https://toolset.com/wp-content/uploads/tmp/overview_with_other_filters_button.png

https://toolset.com/wp-content/uploads/tmp/filters_to_selct.png

Is there any documentation that you are following?

Is there a similar example that we can see? hidden link

What is the link to your site?

#2598633

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Hi there

With the legacy editor you have a lot of control over the markup that is generated; it makes it more customisable, though may require manual intervention to do so.

In this case where you want the filters to initially be hidden and then appear when a "filter" button is clicked, you could inspect how it has been done on the website you linked to and then produce a bespoke implementation of the same on your site, which will involve customising the HTML markup output—which is just a question of changing what is included the editor sections of the View—and adding custom CSS and JS as required.

Or you could try to implement something using either a Bootstrap modal or accordion, which—again—involves modifying the markup output by the View so that, in this case, it corresponds to the Bootstrap requirements, while Bootstrap handles the main CSS and JS required.

See the Bootstrap documentation for modals and accordions at these links:

hidden link
hidden link

Note that the filters are output by the "Search and Pagination" editor of the View, which itself is added to the page by the wpv-filter-meta-html shortcode in the Output Editor section at the end.

If you are not comfortable working on the custom markup required, then you could consult a Toolset contractor for help: https://toolset.com/contractors/

#2598645

Dear Nigel

I need somehow more help with filter in the view, and how I can do this. I need also more an advise how I do set something up like this:

hidden link

I tried to add 2 checkboxes as filter (those are 2 checkbox fields I have in a Repeatable Group. But it's not what I expect.
So I should know if I use fields or if it's better to have taxonomies like category based?

Regards,

Simon

#2598943

Hello,

How do you setup the Repeatable Group?
How do you setup the post view and custom search form?

Here is a document about "Creating a Custom Search in WordPress"
https://toolset.com/course-lesson/creating-a-custom-search/

And Toolset Repeatable Field Group is based on one-to-many relationship, so each Repeatable Field Group is a post type, you can not filter the results by fields of another post type.

Here is a test website:
Login URL:
hidden link

Can you reproduce the same problem in above test site? I need a live website to test and debug.

#2598947

Dear Luo Yang

Yes, it's basically the same in the demo website You sent the link.

I have imported basically everything we have now.

My general question is, would it be better to have fields for such search respectivaly filter criterias? Or would it be better, that we categorize those filter criterias - and use those categories for the filter?

I also could provide You here the login credentials to our website, but I don't see a way to add this in private.

Regards,

Simon

#2598953

You can provide your credentials in below private message box, also point out:
- post view URL
- Frontend page URL

#2598963

Thanks for the details, I assume you are going to filter the results by fields of repeatable field groups "Beach Facts".

I have done below modifications in your website:
Edit post view "Phuket Beach View Main"
hidden link

1) in section "Content Selection", enable option only "Beach Facts", disable option "Phuket Beaches"
2) in section "Loop item in Phuket Beach View Main", change the shortcodes to:

[wpv-post-featured-image item="@beach-facts.parent"]
[wpv-post-title item="@beach-facts.parent"]

Please test again, check if it is what you want.

#2598973

Dear Luo Yang

Thanks for the reply - I am not right sure if You did understand my first request:

We like to have something like this: hidden link

Where it's able to filter for different criterias (filters).

What is the best way to do it? Our main post type is "Phuket Beaches" where we have different fields already, also including relathinships.

I am talking here on the way how to filter and what the best way would be. I have added now single categories to the Phuket Beaches.

The "result You see here: hidden link

This way, it used to show me what beaches does have those infrastructures. I just need to get the results correct.

#2598981

What I am just not sure, how to set the filters in the view, that it should show only those beaches (currently only one), when I am check the checkbox.

If You could help here, would be great.

#2599033

Toolset Repeatable Field Group is based on one-to-many relationship, so each Repeatable Field Group "Beach Facts" is also a post type, if you want to filter the results by fields of Repeatable Field Group "Beach Facts", you will need to:
- Query "Beach Facts" posts
- Filter by fields of Repeatable Field Group "Beach Facts"
- In view's loop, display it's related "Phuket Beaches" post information

You can not filter the results by fields of another post type "Phuket Beaches".

Hope it is clear.

#2599087

Dear Luo Yang

But I can filter the main post type Phuket Beaches - as this is what I like to show - with the categories "attached" to this pst type?

The "Beach Facts" is just additionally information - grouped together - to show then on each Phuket Beaches post type.

We will also have in the future maybe something like "location", as I would make a category from it.

Regards,

Simon

#2599387

Yes, you can setup a post view:
- Query "Phuket Beaches" posts
- Filter by taxonomy "categories" and custom fields(location) of "Phuket Beaches" post type
- In view's loop, display "Phuket Beaches" post information + a child post "Beach Facts" view:
https://toolset.com/course-lesson/creating-and-displaying-repeatable-field-groups/#displaying-repeatable-field-groups

But in above post view, you can not setup filter on fields of Repeatable Field Group "Beach Facts", since "Phuket Beaches" and "Beach Facts" are different pos type, you can not filter the results by fields of another post type

#2599395

Okay, yes, I only need to be able to filter per taxonomies.

But it seems as not to work as I expect it. If You could help to check what I have done wrong: hidden link

By click on "Life guard" or "Sandy beach" I expect that it should show those post in those taxonomies.

If You could check that I can get this done with the filter: hidden link

And whenever a user click those checkboxes, that it's change automatically.

#2599433

I assume you are going to trigger the search form without submit button, I have edited the post view:
hidden link
in section "Custom Search Settings", enable the option "AJAX results update when visitors change any filter values"

Please test again, check if it is fixed, thanks

#2599513

Dear Luo Yang

So far great, and it's what I expecting that it should do.

Quick question - if I like to create basically a separate view - respectively only the "search" part - with slightly different way and have a sumbit button, I just need to change to "AJAX results update when visitors click on the search button"?

Regards,

Simon