Skip to content
Snippets Groups Projects

Beginnings of rendering image normally in the branding block.

Open catch requested to merge issue/drupal-3345259:3345259-logo-image-dimensions into 11.x
Files
4
@@ -151,12 +151,22 @@ public function build() {
$build = [];
$site_config = $this->configFactory->get('system.site');
$logo_uri = theme_get_setting('logo.url');
$build['site_logo'] = [
'#theme' => 'image',
'#uri' => theme_get_setting('logo.url'),
'#uri' => $logo_uri,
'#alt' => $this->t('Home'),
'#attributes' => ['loading' => 'eager', 'fetchpriority' => 'high'],
'#access' => $this->configuration['use_site_logo'],
];
$image = \Drupal::service('image.factory')->get($logo_uri);
if ($image->isValid()) {
$build['site_logo']['width'] = $image->getWidth();
$build['site_logo']['height'] = $image->getHeight();
}
else {
dump('boo');
}
$build['site_name'] = [
'#markup' => $site_config->get('name'),
Loading