Tell us what you are trying to do? We like to achieve a similar website as enlace oculto
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? enlace oculto
What is the link to your site?
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:
enlace oculto
enlace oculto
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/
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:
enlace oculto
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
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:
enlace oculto
Can you reproduce the same problem in above test site? I need a live website to test and debug.
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
You can provide your credentials in below private message box, also point out:
- post view URL
- Frontend page URL
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"
enlace oculto
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.
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: enlace oculto
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: enlace oculto
This way, it used to show me what beaches does have those infrastructures. I just need to get the results correct.
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.
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.
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
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
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: enlace oculto
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: enlace oculto
And whenever a user click those checkboxes, that it's change automatically.
I assume you are going to trigger the search form without submit button, I have edited the post view:
enlace oculto
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
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