The header tags and 'Location(s)' html are currently in the module. They can be moved to the theme easily with the attached patches.

CommentFileSizeAuthor
location.module_17.patch1.77 KBcrunchywelch

Comments

bkat’s picture

I came up with pretty much the same thing as you except that I prefer seeing "Location" or "Locations" as appropriate:

function theme_locations($locations = array(), $hide = array()) {
  $output = '';
  if ($locations) {
      $output = '<h3>'. t('Location' . (count($locations) > 1 ? 's' : ''))
          .'</h3>';
  }

  foreach ($locations as $location) {
    $output .= theme('location', $location, $hide);
  }

  return $output;
}

An example of a nicely themed location info is at
http://womensfooty.com/node/1071

ray007’s picture

+1 from me on this.
Would be even better if there was a way to disable showing the h3-titles without overwriting the theming functions.

ankur’s picture

Status: Needs review » Fixed

Committed to the DRUPAL-5 branch.
Tagged DRUPAL-5--2-7.

Thanks for the patch.

-Ankur

bkat’s picture

Status: Fixed » Needs work

The patch and the code that was checked in will cause the

to be printed even if the locations array is empty.
function theme_locations($locations = array(), $hide = array()) {
  $output = '<h3>'. t('Location(s)') .'</h3>';
  foreach ($locations as $location) {
    $output .= theme('location', $location, $hide);
  }

  return $output;
}

This is because location.module does things like

          if ($output = theme('locations', $posted_locations, variable_get('location_suppress_country', 0) ? array('country') : array())) {
            $node->content['locations']['#value'] .= $output;
          }

might I suggest changing it to:

function theme_locations($locations = array(), $hide = array()) {
  $output = '';
  if ($locations) {
      $output = '<h3>'. t('Location(s)') .'</h3>';
      foreach ($locations as $location) {
          $output .= theme('location', $location, $hide);
      }
  }

  return $output;
}
csc4’s picture

This seems an excellent change - any chance to get it committed?

bdragon’s picture

Status: Needs work » Fixed

Fixed in the 3.x series -- moved out to template file.

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.