Field

Some extra's for field components.

 

Simplified HTML

Stripped away some unneeded div's to keep semantics as clean as possible.

 

Extra functions

Create the possibility to have field-format-specific and field-name-specific preprocess functions.

So inside field--full-html.theme you could now have this function:

<?php

/**
 * Implements template_preprocess_hook().
 */
function compony_preprocess_field__full_html(&$variables, $hook) {
  // Do custom preprocessing here, 
  // only for fields with the full_html field-formatter. 
}

Additionally, you could also preprocess based upon field-name, so inside field--my-field-name.theme you could now have this function:

<?php

/**
 * Implements template_preprocess_hook().
 */
function compony_preprocess_field__my_field_name(&$variables, $hook) {
  // Do custom preprocessing here, 
  // only for the my_field_name field. 
}

(Docs: Extending hooks yourself)

Specifications

Machine name

field

Built upon

Drupal Core

Perks

Responsive
Accessible

Building blocks

HTML

Stats

Public component
75 downloads
No open issue

Contributors