I'm building a site that has a directory listing and I want to allow the user to browse by location. The ideal scenario would be that they would follow this sort of a path:
- go to site.com/browse and select a country
- this loads site.com/browse/category/uk, then select a region
- this loads site.com/browse/category/uk/northern-ireland, then select a county
- this loads site.com/browse/category/uk/northern-ireland/antrim, then select a town/city/area
- this loads site.com/browse/category/uk/northern-ireland/antrim/belfast
Now, I think I can do this using EE categories. I could even load up the sub categories over ajax each time they select a parent category.
The category structure in EE for locations would look something like this:
My issue is that even with 1 country, there would be a lot of categories. I can handle this neatly on the frontend using GWcode Categories I think. But what about the EE CP. If I click to edit an entry, it would need to load up all these categories in a list. That's a lot. What about when we decide to add another country and need loads more categories again. I want to build this right from the start and don't want to have to re-engineer it later. Another problem is trying to import all those categories. There doesn't seem to be a way to do it. I know there are addons like WB Category Select and JP Category Select, but they still don't solve the issue of having 1000s of categories.
This leads me to believe that I should put all the locations into their own channel and use Playa or a relationship field as a way to display them and allow the user to choose them. But if I do this, is there a way in the channel entry page to allow the user to select the first level (country), which would then populate the second level, and so on? Maybe we need to make our own field type or is there something out there I just haven't found yet.
Then, if this is possible, I would need to filter the entries based on their relationship field. I suppose I'd need to use a mix of freebie to get the filter from the url and use playa to filter based on this.
I suppose I'm asking if I'm over complicating this whole thing or is there an easier way of doing this? Any advice or suggestions would be greatly appreciated.