function amp_entity_view_mode_alter in Accelerated Mobile Pages (AMP) 7
Same name and namespace in other branches
- 8.3 amp.module \amp_entity_view_mode_alter()
- 8 amp.module \amp_entity_view_mode_alter()
- 8.2 amp.module \amp_entity_view_mode_alter()
Implements hook_entity_view_mode_alter().
Switches view mode to 'amp' for AMP requests.
File
- ./
amp.module, line 333
Code
function amp_entity_view_mode_alter(&$view_mode, $context) {
if ($view_mode === 'full' && amp_is_amp_request()) {
$view_mode = 'amp';
}
}