Search for school page

Good day, I am fairly new to Bubble and have learnt a lot in the past few weeks, but have gotten quite stuck on this one issue. Please assist if you can?

I am creating a website with a page per school in my area. I’d like to have a search bar in my Header where users can find a school that is on my system and when they do, it will send them to that school’s page.

How should I create the Schools? As a data type or option set? And then how do I link the school page to that school?

Hello!

Schools should be a data type, since you’d probably want to add more than just a name for schools, and you’d probably want to reference all that stuff further, so Data type is the logical approach.

As far as the search is concerned, you’d probably be displaying the school details when the user searches. There are a few ways to do this, but considering you want the search bar to be in the header, I’d recommend using a repeating group to display the results - when a user clicks on an option the workflow would be “Go to page display_school” and send the school’s unique id/ slug as an additional parameter. Set up an “On page load” condition on the display_school page to search for the school parameter being sent and display it in a group (use this group to populate other groups on this page)

I hope that clarifies it! Let me know if you need further clarification :slight_smile:

Thank you so much. I think it has worked.

But now I have come into another issue, When I test the search function I can find the schools and go their page now but if the test that I put in the search bar doesn’t exactly match the school name then it sends me to the school page with empty data. I have tried a few things using the “Only when” function but nothing is working? Any suggestions?

Im so sorry for being inactive and not seeing it sooner.

You need 2 things:

  1. A search bar
  2. A fuzzy search plugin

You can use bubble’s stock Search element. Using a search element allows the user to get suggestions for matches.

You need a fuzzy search plugin like Fuzzy search and autocomplete by Zeroqode: Fuzzy search & Autocomplete Plugin | Bubble
The plugin documentation will show you how to implement the plugin and ensure that you get matching suggestions to the searchbox, even if you dont spell it correctly

Hope that helps!

This topic was automatically closed after 70 days. New replies are no longer allowed.