Needs review
Project:
Countries
Version:
7.x-2.3
Component:
Views integration
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
20 Aug 2013 at 19:54 UTC
Updated:
27 Aug 2015 at 09:48 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
alan d. commentedcan u supply an export of the view for me to take a look at it please
Comment #2
johnv@ezeedub, please examine the three attached printscreens, of my taxonomy view with a country field. I think this is what you mean.
Comment #3
alan d. commentedI think that ezeedub has an actual country view, otherwise it is fairly hard to miss the formatter options for the country field. Must be fairly easy, I walked someone through creating the view here: #2051015: How to add Country Icons to the administrative table of countries, but can not see how the icon is inserted with PHP or a custom template that runs some PHP.
One way is (quick hack and would not be the final version):
countries.info
views/countries.views.inc
and the attached file, renamed to views/views_handler_field_countries_flag.inc
Comment #4
alan d. commentedSimple field listing:
Producing:

Comment #5
alan d. commentedIn #2051015: How to add Country Icons to the administrative table of countries, that user added a computed field that stored the icon and that allowed him to render the flag just like any other field.
I'll keep this issue open for a views field handler ;)
Comment #6
roball commentedA views field handler implemented by the Countries module would be an awesome addition! This would no longer need the Computed Field module to be involved. Very user-friendly :-)
Comment #7
ezeedub commented@Alan D Yes, I have a view of countries. Your solution in #3 is exactly what I was thinking. Why do you think it's temporary?
Here's a patch version. I removed the continent_code checkbox. I'm also thinking we could remove the Icon suffix here, since there are already views fields for those properties.
Comment #8
ezeedub commentedforgot to change status
Comment #10
alan d. commentedBecause it duplicates a significant amount of code... This should be handled by a helper function so that both of these forms stay sync'ed ;)
Comment #11
ezeedub commentedAh, that. Good point by you! :)
Comment #12
earelin commentedI have updated the patch. Now is not using deprecated function countries_get_country and maybe is going to pass testing.
Comment #13
earelin commentedError fixed in the rendering fuction
Comment #14
alan d. commentedNeeds review will trigger the testing (albeit that isn't that comprehensive)
Comment #17
earelin commentedComment #19
earelin commentedI have updated the issue to the last version, the patch is not for 2.1. Now it has passed the test.
Comment #20
roball commentedPatches should however always be made against the current Git branch (7.x-2.x), which corresponds to the 7.x-2.x-dev release snapshot.