Advertisement
Guest User

Untitled

a guest
Feb 10th, 2016
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.34 KB | None | 0 0
  1. use DrupalnodeNodeInterface;
  2. use DrupalCoreEntityEntityInterface;
  3. use DrupalCoreEntityDisplayEntityViewDisplayInterface;
  4.  
  5. function hook_entity_view_alter(&$build, EntityInterface $entity, EntityViewDisplayInterface $display){
  6. if($entity->getType() == 'relevant_type'){
  7. $build['#cache']['contexts'][] = 'headers:User-Agent';
  8. }
  9.  
  10. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement