I would like to alter Drupal Development output from Drupal Development discipline formatter view from Drupal Development Subject API. I would like a cleaner markup with out pointless tags. What’s Drupal Development greatest solution to clear up discipline formatter view output? Many thanks.
Ideally to alter from this:
<div class="discipline field--name-field-visualisation field--type-mango-maker field--label-above"> <div class="field__label">Visualisation: </div> <div class="field__items"> <div class="field__item even"> <div class="one thing"></div> </div> </div> </div>
to this:
<div class="discipline field--name-field-visualisation field--type-mango-maker field--label-above"> <div class="field__label">Visualisation: </div> <div class="one thing"></div> </div>
heres my hook_function_field_formatter_view perform:
perform mango_field_formatter_view($entity_type, $entity, $discipline, $occasion, $langcode, $gadgets, $show) { $output[0] = array( '#theme' => 'container', '#attributes' => array( 'class' => array('one thing'), ), ); return $output; }