Programmatically get input format in field template We change some output in our field.tpl-files for body fields, depending on the input format that was used on the node (which itself depends on the user being able to modify it). 

Now this worked by drilling down to $element['#object']->body["und"][0]["format"] but that's hardly best practice as illustrated by helpful articles. 

But – what is the correct way to get a reliable, language-agnostic variable like $ouptut['format']? 

Thanks for any infos on that!
I would suggest you to create separate template based on field's text format. 
Here is the way: 


Create a TEMPLATE_preprocess_field function in template.php file of your theme.
Copy and paste a file named "field.tpl.php" and rename it to "field--[your-field-name]--[its-text-format].tpl.php.


The function is : 

function MYTHEME_preprocess_field($variables) {
  switch ($variables['element']['#field_name']) {

case 'body':
  $element = $variables['element'];
  $entity_type = $element['#entity_type'];
  $field_name = $element['#field_name'];
  $language = $element['#language'];
  $entity = $element['#object'];
  $values = field_get_items($entity_type, $entity, $field_name, $language);
  $item = array_shift($values);
  $format = $item['format'];
  $variables['theme_hook_suggestions'][] = 'field__' . $field_name . '__' . $format;
  break;
      }
    }