Closed (duplicate)
Project:
Location
Version:
5.x-3.x-dev
Component:
Code
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
23 Jul 2008 at 00:42 UTC
Updated:
23 Apr 2009 at 03:45 UTC
I'd like to output just the city, state and country when a node is being viewed in teaser view. I'm able to add the city and state with no problem using the content templates (contemplates) module. However, when I go to add the country name using $node->location['country'], the country code gets outputted ('us' instead of 'United States'). Does anyone know how to change this?
Another issue I'm having is that when a node is viewed in full view, the location always falls to the bottom of the content area regardless of what weight I give it.
Comments
Comment #1
sodani commentedI was able to do this with the following code:
$country_names = location_get_iso3166_list();
print $country_names[$node->location['country']];
However, I wonder if this is the most straightforward way to do this.
Comment #2
bdragon commentedComment #3
bowwowadmin commentedI need this also. I am trying to have the country name of the author of the nodes. where do I put the #1 code?
Comment #4
summit commentedsubscribing. Is it also possible to alter the language of the country, to get the dutch translation on the screen?
Greetings,
Martijn
Comment #5
yesct commentedlooks like the comment is #2 is a fix for the original poster.
Also, this seems to be a duplicate of #196263: How to get the country name from the country ISO code (which has a slightly different solution)
For the second half of your question, please open a new issue.
Also, Summit, for your question in #4, please open a new issue.
You can add a link back to this issue number if you think that is relevant.
Thanks! I think separating out the issues will help get you the help you need better.
Comment #6
yesct commentedtagging with translation.
Comment #7
yesct commentedrelated to #420204: location country-name instead of country-code in views argument ?
Comment #8
yesct commentedrelated to #427502: How to get frrom countryname to country-id and then translate it in my language (Dutch)? ?
Comment #9
yesct commentedtagging