Skip to main content
2 of 2
deleted 1 characters in body
Capi Etheriel
  • 3.4k
  • 2
  • 19
  • 40

Here is an alternative to @Kenny and @Bearden solution, using template preprocess instead of overriding the template. Not only it makes for a more readable solution, you can reuse it for other views. It should also work for list summaries, just remove _unformatted from the function name.

/**
 * Implements hook_preprocess_views_view_summary_unformatted().
 */
function MYTHEME_preprocess_views_view_summary_unformatted($variables) {
  if ($variables['view']->name == MYVIEW) {
    // Necessary for country_get_list().
    include_once DRUPAL_ROOT . '/includes/locale.inc';
    $countries = country_get_list();

    // Looping through the row keys for performance reasons.
    foreach (array_keys($variables['rows']) as $rowid) {
      $countryid = $variables['rows'][$rowid]->link;
      if (!empty($countries[$countryid])) {
        $variables['rows'][$rowid]->link = $countries[$countryid];
      }
    }
  }
}
Capi Etheriel
  • 3.4k
  • 2
  • 19
  • 40