Skip Navigation

[Resolved] 1 post with many locations, selective data displayed based on search (zip code)

This support ticket is created 4 years, 3 months ago. There's a good chance that you are reading advice that it now obsolete.

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
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10: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/Kolkata (GMT+05:30)

This topic contains 4 replies, has 2 voices.

Last updated by Minesh 4 years, 3 months ago.

Assisted by: Minesh.

Author
Posts
#2067173

Tell us what you are trying to do?
I have a post type called services. In this post type, I would like to have only specific information displayed, based on the search. For example, when someone enters a zip code, I would like the phone number and clinic name that services that zip code. Is this possible?

Is there any documentation that you are following?
There isn't, I'm trying to come up with a solution based on the abilities of the plugin.

Is there a similar example that we can see?
Not that I know of.
Imagine a directory where Sharp Hospital has clinics all over the city. Each clinic only services certain zip codes, so I would like to have the ability to associate specific phone numbers and clinic names (no addresses, this is a come-to-your-home service) displayed from the post, based on the zip code the person enters. My goal is to create one post containing all this data, rather than creating up to 10 separate posts for each service provider. (hundreds of posts potentially)

Sharp, Mary Birch Center 555-555-5551
Sharp, Allen Gold Center 555-555-5552
Sharp, Ronald Moore Center 555-555-5553
Etc...

What is the link to your site?
I don't have anything up yet - just have the plugin installed and am working out the data.

#2067227

Here is an example of some location information: hidden link

The goal is if someone adds the zipcode: 92116, only the San Diego Central NFP information will be displayed along with the post title and description from this post. I can make a video of the post page if that is more helpful.

Thanks again.

#2067521

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

Based on the screenshot, I see you have created the repeating field group and within the repeating field group you have added the multiline field where you are adding the zipcodes.

What if you try to create a view that should query the repeating field group and add the frontend filter for the custom field "Zip Code" and then within the view's loop editor try to display the related parent.

Will that help?

#2068439

I will give that a shot tonight. I'm not seeing how to add the fields from the repeater in the view builder though. If I make that data not a repeater, then it will show up when building the container in the view... Any idea what I might be missing? I can post a screenshot later if you don't happen to know off the top of your head.

Thanks so much!

#2068725

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

You need to create custom search view and add your field as custom search field.

More info (using Blocks):
=> https://toolset.com/course-lesson/creating-a-custom-search/
Or
More info (using Classic Views):
=> https://toolset.com/documentation/legacy-features/views-plugin/front-page-filters/