Loading themes/bs_bootstrap/bs_bootstrap.theme +22 −2 Original line number Diff line number Diff line Loading @@ -324,14 +324,34 @@ function bs_bootstrap_preprocess_block(&$variables) { $variables['site_logo'] = $logo_path_language; } $logo_attributes = ['class' => ['site-logo']]; if ($logo_path_info['extension'] === 'svg') { // Inline SVG logo. if (bs_bootstrap_get_setting('logo_svg_inline') && $logo_path_info['extension'] === 'svg') { if (bs_bootstrap_get_setting('logo_svg_inline')) { $variables['site_logo_svg'] = file_get_contents(DRUPAL_ROOT . $variables['site_logo']); } } else { // Get the logo width and height. if (file_exists(DRUPAL_ROOT . $variables['site_logo'])) { /** @var \Drupal\Core\Image\Image $image */ $image = \Drupal::service('image.factory')->get(DRUPAL_ROOT . $variables['site_logo']); $logo_attributes['width'] = $image->getWidth(); $logo_attributes['height'] = $image->getHeight(); } $config = \Drupal::config('system.site'); $variables['site_logo_alt_text'] = t('@site_name logo', ['@site_name' => Xss::filter($config->get('name'))]); $logo_attributes['alt'] = t('@site_name logo', ['@site_name' => Xss::filter($config->get('name'))]); // Keep the old site_logo_alt_text for compatibility with older // custom themes that are using site_logo_alt_text. // @TODO - remove for 2.x version. $variables['site_logo_alt_text'] = $logo_attributes['alt']; } $variables['logo_attributes'] = new Attribute($logo_attributes); } break; } } Loading themes/bs_bootstrap/templates/block/block--system-branding-block.html.twig +1 −1 Original line number Diff line number Diff line Loading @@ -22,7 +22,7 @@ {%- if site_logo_svg -%} {{- site_logo_svg|raw -}} {%- else -%} <img src="{{ site_logo }}" alt="{{ site_logo_alt_text }}" class="site-logo"/> <img src="{{ site_logo }}" {{ logo_attributes }} /> {%- endif -%} </a> {%- endif %} Loading Loading
themes/bs_bootstrap/bs_bootstrap.theme +22 −2 Original line number Diff line number Diff line Loading @@ -324,14 +324,34 @@ function bs_bootstrap_preprocess_block(&$variables) { $variables['site_logo'] = $logo_path_language; } $logo_attributes = ['class' => ['site-logo']]; if ($logo_path_info['extension'] === 'svg') { // Inline SVG logo. if (bs_bootstrap_get_setting('logo_svg_inline') && $logo_path_info['extension'] === 'svg') { if (bs_bootstrap_get_setting('logo_svg_inline')) { $variables['site_logo_svg'] = file_get_contents(DRUPAL_ROOT . $variables['site_logo']); } } else { // Get the logo width and height. if (file_exists(DRUPAL_ROOT . $variables['site_logo'])) { /** @var \Drupal\Core\Image\Image $image */ $image = \Drupal::service('image.factory')->get(DRUPAL_ROOT . $variables['site_logo']); $logo_attributes['width'] = $image->getWidth(); $logo_attributes['height'] = $image->getHeight(); } $config = \Drupal::config('system.site'); $variables['site_logo_alt_text'] = t('@site_name logo', ['@site_name' => Xss::filter($config->get('name'))]); $logo_attributes['alt'] = t('@site_name logo', ['@site_name' => Xss::filter($config->get('name'))]); // Keep the old site_logo_alt_text for compatibility with older // custom themes that are using site_logo_alt_text. // @TODO - remove for 2.x version. $variables['site_logo_alt_text'] = $logo_attributes['alt']; } $variables['logo_attributes'] = new Attribute($logo_attributes); } break; } } Loading
themes/bs_bootstrap/templates/block/block--system-branding-block.html.twig +1 −1 Original line number Diff line number Diff line Loading @@ -22,7 +22,7 @@ {%- if site_logo_svg -%} {{- site_logo_svg|raw -}} {%- else -%} <img src="{{ site_logo }}" alt="{{ site_logo_alt_text }}" class="site-logo"/> <img src="{{ site_logo }}" {{ logo_attributes }} /> {%- endif -%} </a> {%- endif %} Loading