Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- use DrupalnodeNodeInterface;
- use DrupalCoreEntityEntityInterface;
- use DrupalCoreEntityDisplayEntityViewDisplayInterface;
- function hook_entity_view_alter(&$build, EntityInterface $entity, EntityViewDisplayInterface $display){
- if($entity->getType() == 'relevant_type'){
- $build['#cache']['contexts'][] = 'headers:User-Agent';
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement