Add continent to filter country

Created on 14 November 2024, about 2 months ago

In case the country selection list is too large, it is best to have a filter by continent. Adding continents will help to reduce the time spent selecting countries.

In this patch it will create a new widget "Country with continent options"

- add country flag (if multi value)
- add select to filter countries

Feature request
Status

Needs work

Version

2.1

Component

User interface

Created by

🇫🇷France lazzyvn paris

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @lazzyvn
  • 🇳🇱Netherlands batigolix Utrecht

    Thanks! This is a lovely idea.

    But it adds a lot of extra code to maintain.

    Also I am not sure if it is helpful in all situations if you first have to figure out which continent a country is in (what to do with Turkiye, Russia, etc.) . So it probably should be optional and configurable which adds a lot more additional code to maintain.

    I will set this a "Wont fix".

    People that like to have it can use the patch.

  • 🇫🇷France lazzyvn paris

    No, it's not a code modification, it's adding a new file widget, that's all.

  • 🇳🇱Netherlands batigolix Utrecht

    Ok, thanks for pointing out that this is a widget. I did not study the patch well enough.

    Good to hear that you have time to work on the maintenance of this module. Reviews and patches are always welcome.

    This widget could be considered a new feature but it needs to work.

    - It should work without the custom JavaScript, so maybe by using Drupal form state (see e.g. https://git.drupalcode.org/project/examples/-/blob/4.0.x/modules/form_ap...), or with collapsible fieldsets.

    - The flag icons CSS should not be part of the code, since a similar feature is offered by the Flags module

    - Continents need to be configurable, since there is no objective way of deciding which continents exist and to which continents certain countries (turkiye for example) belongs to. I am thinking that maybe there should be a configurable way to group countries , not per se per continent, but something more generic. You could then group countries in all different ways.

    It is possible that more requirements are being discovered later on, so keep that in mind when working on it.

  • 🇳🇱Netherlands batigolix Utrecht

    If there is someone that like to work on the issues mentioned in #5, please let me know. Otherwise I will close this.

  • 🇫🇷France lazzyvn paris

    It's strange with your request. It feels like you don't understand how this widget works.
    Continent it's simply a filter based on the countries rendered in the list you can choose a country in this continent and a country in another continent. if using php drupal to render it reduces the user experience.
    the flags have an option to customize whether to display, it's simply embedded in the cdn flag font then jascript will add the icon prefix to this to help the site load quickly and lightly.
    Configuring the country by continent can do in module config. but it will affect the performance every time the field loads. I used the international standard set to set up (ISO 3166-1:2020 and UN Geoscheme). Who wants to change it themselves?

Production build 0.71.5 2024