Skip to content

Instantly share code, notes, and snippets.

@opi
Last active December 14, 2015 18:59
Show Gist options
  • Save opi/5133233 to your computer and use it in GitHub Desktop.
Save opi/5133233 to your computer and use it in GitHub Desktop.
theme_field
function _node_view_static_field($field_name, $title, $markup, $weight = 0) {
return array(
'#theme' => "field",
'#weight' => $weight,
'#title' => $title,
'#access' => TRUE,
'#label_display' => "inline",
'#view_mode' => "full",
'#language' => "und",
'#field_name' => $field_name,
'#field_type' => "text",
'#field_translatable' => 0,
'#entity_type' => 'node',
'#bundle' => BUNDLE,
'#formatter' => "text_default",
'#items' => array(0 => array('#markup' => $markup)),
0 => array('#markup' => $markup),
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment