Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
On my site, I have a field, "Nationality," that allows users to select their home country. When I show this field in Views, thanks to the Countries module integration I am able to display the flag of the relevant country.
However, I would also like to be able to display the flags of each country within the countries select widget on the node/user edit page. For example, like the widget provided by the Language Switcher Dropdown module.
Thank you for your consideration!
Comments
Comment #1
Scyther CreditAttribution: Scyther commentedCountry Icons only provides flags and a API for displaying them. So this should be a request to the Countries module to have them displayed in the select list for that field.
Comment #2
Alan D. CreditAttribution: Alan D. commentedSorry to play ping-pong with the issue, but this feature would be useful on any country drop-down, particularly as core defines one too.
OK, some of the notes that I have gathered by looking at the existing solutions:
I think that the MSDropDown library should be independently installed in the sites/all/libraries.
Quick first stab at a possible implementation (JQuery side).
The functionality could be inserted via an after_build to make it easy for this to be attached to any select element, either FAPI (like core) or Fields (like Countries module)
ie. Define a new after_build on the SELECT element.
If #country_icons FAPI property is set, append & setup the magic.
Thoughts? I am not sure how much time I personally have atm to develop this idea
Comment #3
Scyther CreditAttribution: Scyther commentedIt looks good. But I don't think this should be included in this module. Maybe the best way is to have a own module for this?
Comment #4
philchen CreditAttribution: philchen commentedDid this feature ever made though to the code?
Thanks!