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

sodani’s picture

I 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.

bdragon’s picture

Version: 6.x-3.x-dev » 5.x-3.x-dev
bowwowadmin’s picture

I need this also. I am trying to have the country name of the author of the nodes. where do I put the #1 code?

summit’s picture

subscribing. Is it also possible to alter the language of the country, to get the dutch translation on the screen?
Greetings,
Martijn

yesct’s picture

Status: Active » Closed (duplicate)

looks 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.

yesct’s picture

Issue tags: +location translation

tagging with translation.

yesct’s picture

yesct’s picture