function amp_preprocess_block in Accelerated Mobile Pages (AMP) 8.3
Same name and namespace in other branches
- 8 amp.module \amp_preprocess_block()
Implements hook_preprocess_HOOK() for block templates.
File
- ./
amp.module, line 473 - Provides functionality for handling AMP.
Code
function amp_preprocess_block(&$variables) {
switch ($variables['base_plugin_id']) {
case 'amp_system_branding_block':
$variables['site_logo'] = '';
if ($variables['content']['site_logo']['#access'] && $variables['content']['site_logo']['#uri']) {
$variables['site_logo'] = $variables['content']['site_logo']['#uri'];
$variables['logo_width'] = $variables['content']['logo_width'];
$variables['logo_height'] = $variables['content']['logo_height'];
}
$variables['site_name'] = '';
if ($variables['content']['site_name']['#access'] && $variables['content']['site_name']['#markup']) {
$variables['site_name'] = $variables['content']['site_name']['#markup'];
}
$variables['site_slogan'] = '';
if ($variables['content']['site_slogan']['#access'] && $variables['content']['site_slogan']['#markup']) {
$variables['site_slogan'] = [
'#markup' => $variables['content']['site_slogan']['#markup'],
];
}
break;
}
}