Forums › Forums › Search & Filter Pro › Custom Search Elements
- This topic has 10 replies, 2 voices, and was last updated 5 years, 1 month ago by Trevor.
-
Anonymous(Private) October 24, 2019 at 7:46 am #224497
I have a need to have a custom search element that is requested by a client. We are searching by locations and the client would like to mirror a small version of a map that we’ve already used in a non-search fashion elsewhere in the site.
We have an ACF field already set up where the destination is placed in one of 6 regions. We use an SVG and clickable paths to trigger jQuery events and swap out info about those regions.
Can you think of a way that I can link a click action and filter or interface with your form results?
ALSO, in the same vein they would like to have a full calendar where a person can click a day and filter by events that only appear on that day.
Destination and Events are both CPT.
The plugin is working beautifully so far. Any help or thoughts is very appreciated.
Trevor(Private) October 24, 2019 at 6:39 pm #224552Hi Matt
I cannot think of any way to do as you want (not that it might be impossible), but what you ask for is a long way outside the scope of our technical support. You are in to very experimental territory here I think.
As you are using the Post Type Archive method, as the loop is run in the template (the if have posts while have posts part), you would need to build an array whilst running through the while part, and after that, but before the end of the if, output the map using that array you have just built. That will restrict the map to being after the results.
Anonymous(Private) October 30, 2019 at 7:57 pm #225184So I decided to use the native form elements for both region and calendar as I liked being able to specify a date range and multi select for region.
The plugin works fantastically. Really stellar job.
I am however running into another issue which I will describe here:
If I am on the post type archive page I can filter by region (one or more ACF values) without problem. However if I add a category (custom post type taxonomy) in the mix the region filter seems to be ignored. I will put the links in a follow-up private comment.
Trevor(Private) October 31, 2019 at 2:02 pm #225225I am wondering if this is because you have enabled OR for the Field Relationships, and more than one selection is possible in the taxonomy?
Can you test if with the ‘Enable filtering on Taxonomy Archives’ set to OFF?
I appreciate that this will impact the URLs, but I don’t think multiple selection in a taxonomy can be refected in the URL, so it fails.
Anonymous(Private) October 31, 2019 at 4:10 pm #225235I tried ‘Enable filtering on Taxonomy Archives’ set to OFF and it seemed to have no effect on the results aside from altering the URL so I turned it back on. What seemed to fix it was changing the OR to AND in field relationships.
I assumed that AND would not work for multi selection since each entry contains only one region value and would cancel out. I thought that OR would allow multiple selections that would pull in the selected regions but instead it made them irrelevant.
I’ll have to try and wrap my mind around it later but it seems to be working as per my needs for now.
Thanks!
-
AuthorPosts