How to change the markup for a field I'd like to change the output from the field formatter view from the Field API. I'd like a cleaner markup without unnecessary tags. What's the best way to clean up field formatter view output? Many thanks.

Ideally to change from this: 

&lt;div class="field field--name-field-visualisation field--type-mango-maker field--label-above"&gt;
    &lt;div class="field__label"&gt;Visualisation:&amp;nbsp;&lt;/div&gt;
    &lt;div class="field__items"&gt;
        &lt;div class="field__item even"&gt;
            &lt;div class="something"&gt;&lt;/div&gt;
        &lt;/div&gt;
    &lt;/div&gt;
&lt;/div&gt;


to this:

&lt;div class="field field--name-field-visualisation field--type-mango-maker field--label-above"&gt;
    &lt;div class="field__label"&gt;Visualisation:&amp;nbsp;&lt;/div&gt;
    &lt;div class="something"&gt;&lt;/div&gt;
&lt;/div&gt;


heres my hook_function_field_formatter_view function:

function mango_field_formatter_view($entity_type, $entity, $field, $instance, $langcode, $items, $display) {

  $output[0] = array(
    '#theme' =&gt; 'container',
    '#attributes' =&gt; array(
      'class' =&gt; array('something'),
    ),
  );
  return $output;
}
If you want to change output of the field in a Views, use Semantic Views

You can also turn on the Theme Developer module, check which .tpl is used to display piece of content you want to change and then create this file in a way you want.

Another modules that provide similar functionalities are:

Quickest solution, just turn this module and forget about drupal's nested divs:

Fences

More complex, this lets you to set up fields markup - for views as well as full node: 

Semantic CCK

The most complex, apart from fields markup, this lets you to set up columns, headers, footers etc. inside of full node view, as well some views integration:

Display Suite