Skip Navigation

[Resolved] How to improve the UI when using a Country > City taxonomy

This thread is resolved. Here is a description of the problem and solution.

Problem:
With many countries and cities in a Country > City hierarchical taxonomy the UI is very user unfriendly, can it be improved.

Solution:
Try a plugin such as https://wordpress.org/plugins/collapsible-categories-in-the-dashboard/

This support ticket is created 6 years, 6 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
- 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 -
- 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 -

Supporter timezone: Europe/London (GMT+00:00)

This topic contains 1 reply, has 2 voices.

Last updated by Nigel 6 years, 6 months ago.

Assisted by: Nigel.

Author
Posts
#914495

I have a moving company firm that makes international moves of homes.

What I want to achevie.
1. I want to add x countries and in them add multiple cities for each country. I´ve created a Post type called "Geolocation".
2. In this posttype I added custom field called "Country".
3. So what is the best way or field to use when I want to to add multiple cities?
(There could be all from 5 to 50 depending on the country itself)

This cities will then be used in a another Custom Post Type called "Moving Companies".
This Moving Companies I add will have a alot fo fields and information AND also checkboxes with Countries and below also Cities that I added in the "Geolocation" post type. Is this possible in a simple way with your types plugin?

There will be hundreds of cities with all the countries, so is there a way to just show the countries and then in a deeper level show the cities if you understand what I mean in the section of "Moving Companies".

All things are just for backend and will not be visible or be alternatives for the visitors....

Thanks for your time with this and help in advance.

#914615

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

geo.gif

Hi Robert

There really isn't a very nice solution built into WordPress for something like this in terms of the UI, or that Toolset can add.

You could have two separate fields, one for country and one for cities, but such fields are not connected, so there is no way to have it such that you first select the country and then the second selector only contains cities belonging to that country.

You could use a library such as select2.js to create a custom solution.

I think a custom taxonomy possibly makes more sense in this case, as you can have a hierarchical taxonomy for locations where the first level is the country and the second level is the city (and taxonomies are much more efficient if you ever need to run queries based on location, e.g. show me movers in Boston).

The default UI for entering hierarchical taxonomies is a bit problematic, because once you have checked one or two terms the hierarchical display is lost.

Various people have released plugins that aim to improve upon this, and I found the "Collapsible Categories in the Dashboard" to do a pretty good job, see the screen recording.

https://wordpress.org/plugins/collapsible-categories-in-the-dashboard/