Created
April 9, 2013 15:08
-
-
Save wimleers/5346477 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Implements hook_entity_view_alter(). | |
*/ | |
function edit_entity_view_alter(&$build, EntityInterface $entity, EntityDisplay $display) { | |
$build['#attributes']['data-edit-entity'] = $entity->entityType() . '/' . $entity->id(); | |
} | |
// /** | |
// * Implements hook_preprocess_HOOK() for node.tpl.php. | |
// * | |
// * @todo Move towards hook_preprocess_entity() once that's available. | |
// */ | |
// function edit_preprocess_node(&$variables) { | |
// $node = $variables['elements']['#node']; | |
// $variables['attributes']['data-edit-entity'] = 'node/' . $node->nid; | |
// } | |
// /** | |
// * Implements hook_preprocess_HOOK() for taxonomy-term.tpl.php. | |
// * | |
// * @todo Move towards hook_preprocess_entity() once that's available. | |
// */ | |
// function edit_preprocess_taxonomy_term(&$variables) { | |
// $term = $variables['elements']['#term']; | |
// $variables['attributes']['data-edit-entity'] = 'taxonomy_term/' . $term->id(); | |
// } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment