diff --git a/core/modules/system/lib/Drupal/system/Plugin/Block/SystemBrandingBlock.php b/core/modules/system/lib/Drupal/system/Plugin/Block/SystemBrandingBlock.php index fa04d9e..da9d2b8 100644 --- a/core/modules/system/lib/Drupal/system/Plugin/Block/SystemBrandingBlock.php +++ b/core/modules/system/lib/Drupal/system/Plugin/Block/SystemBrandingBlock.php @@ -28,7 +28,7 @@ class SystemBrandingBlock extends BlockBase implements ContainerFactoryPluginInt * * @var \Drupal\Core\Config\ConfigFactoryInterface */ - protected $config_factory; + protected $configFactory; /** * Creates a SystemBrandingBlock instance. @@ -78,7 +78,7 @@ public function blockForm($form, &$form_state) { $form['block_branding'] = array( '#type' => 'details', '#title' => $this->t('Toggle branding elements'), - '#description' => t('Choose which branding elements you want to show in this block instance.'), + '#description' => $this->t('Choose which branding elements you want to show in this block instance.'), '#collapsed' => FALSE, '#collapsible' => FALSE, ); @@ -117,15 +117,12 @@ public function build() { $site_config = $this->configFactory->get('system.site'); $build['#theme'] = 'branding'; - // Logo $build['#use_site_logo'] = $this->configuration['site_logo']; $build['#site_logo'] = theme_get_setting('logo'); - // Site name $build['#use_site_name'] = $this->configuration['site_name']; $build['#site_name'] = $site_config->get('name'); - // Site slogan $build['#use_site_slogan'] = $this->configuration['site_slogan']; $build['#site_slogan'] = Xss::filterAdmin($site_config->get('slogan')); diff --git a/core/modules/system/templates/branding.html.twig b/core/modules/system/templates/branding.html.twig index f134aab..6c77bbf 100644 --- a/core/modules/system/templates/branding.html.twig +++ b/core/modules/system/templates/branding.html.twig @@ -4,6 +4,10 @@ * Default theme implementation for a branding block. * * Available variables: + * - use_site_logo: Block setting on whether to show the site logo. + * - use_site_name: Block setting on whether to show the site name. + * - use_site_slogan: Block setting on whether to show the site slogan. + * * - site_logo: Logo for site. * - site_name: Name for site. * - site_slogan: Slogan for site. @@ -11,12 +15,26 @@ * @ingroup themeable */ #} -{% if use_site_logo %} - -{% endif %} -{% if use_site_name %} -

{{ site_name|e|t }}

+{% if use_site_logo and site_logo %} + {% endif %} -{% if use_site_slogan %} -

{{ site_slogan|t }}

+ +{% if use_site_logo or (use_site_slogan and site_slogan) %} + +
+ + {% if use_site_name %} + + {{ site_name|e|t }} + + {% endif %} + + {% if use_site_slogan and site_slogan %} +
{{ site_slogan|t }}
+ {% endif %} + +
{# /.name-and-slogan #} + {% endif %}