You are here

function token_field_preprocess_content_field in Token Field 6

Implementation of hook_preprocess_content_field()

File

./token_field.module, line 168
Optional extension to CCK (Content Construction Kit) to provide a read-only field which allows embedding of "compound" fields using Tokens.

Code

function token_field_preprocess_content_field(&$vars) {

  // If the field is a token_field content field, we add more template
  // suggestions so that we can easily theme all Token Fields.
  if ($vars['field_type'] == 'field_token') {
    $suggestions = array(
      'content-field-field-token',
      'content-field-field-token-' . $vars['field_name'],
      'content-field-field-token-' . $vars['node']->type,
      'content-field-field-token-' . $vars['field_name'] . '-' . $vars['node']->type,
    );
    $vars['template_files'] = array_merge($vars['template_files'], $suggestions);
  }
}