Building Custom Widget

By: Jaycee Jacobs | Asked: 08/29/2023
ForumsCategory: How-toBuilding Custom Widget
Jaycee Jacobs asked 11 months ago
Hello!

I am wanting to build a widget and was wondering the best way to go about it using the pro version of Formidable. Here are the basics:

  • We are wanting to create a search bar widget that will be embeded on all pages across our website.
  • The search bar will ask users to select their insurance carrier from a drop down and type in their zip code.
  • Upon hitting search, a location (or multiple) in their area will show up. If they selected an insurance carrier that we do not accept, there will be a message directing them to another site.
What would be the best way to go about this? Can I even make something like this with this tool? I can pull together a list of zip codes each facility should show for.
1 Answers
Victor Font answered 11 months ago
For a widget, you would insert the form using PHP. See this Formidable KnowledgeBase article: https://formidableforms.com/knowledgebase/publish-a-form/#kb-php-alternative
Jaycee Jacobs replied 11 months ago

Thank you! But how would I go about building the rest of the widget? Do you know how to upload multiple zip code conditions?

Victor Font replied 11 months ago

Custom widgets use the WordPress Widget API. See this for instructions about how to build a widget: https://codex.wordpress.org/Widgets_API

As for "multiple zip conditions", what do you mean?

Jaycee Jacobs replied 11 months ago

Making sure a location only shows up for a specific set of zip codes. So for example, we have 1 location in New Jersey. If someone is searching for a location near them with a New York zip code, our New Jersey facility should pop up.

Victor Font replied 11 months ago

You just changed the ball game! You're looking at an integration with Google Places. The Geolocation add-on may get you where you need to go just by displaying your locations on a map. But if really need to calculate radius, that's going be a custom Places API call assuming Google reveals that info in the Places API.

Making the Best WordPress Plugin even better - Together

Take on bigger projects with confidence knowing you have access to an entire community of Formidable Experts and Professionals who have your back when the going gets tough. You got this!
Join the community
crossarrow-right