0

I'm very new to drupal 8 and I'm doing my first custom template, but I'm having some trouble at the very beginning. I'm trying to get in the page.html.twig the site_logo, but that is always null. I've checked that in my block setting the checkbox "Toggle branding elements" is enabled. The code is simply the following but no way to show the logo. What am I missing?

    {% if site_logo %}
    <a class="logo navbar-btn pull-left" href="{{ path('<front>') }}" title="{{ 'Home'|t }}" rel="home">
      <img src="{{ site_logo }}" alt="{{ 'Home'|t }}" />
    </a>
  {% endif %}
  {% if site_name %}
    <a class="name navbar-brand" href="{{ path('<front>') }}" title="{{ 'Home'|t }}" rel="home">{{ site_name }}</a>
  {% endif %}
  {% if site_slogan %}
    <p class="navbar-text">{{ site_slogan }}</p>
  {% endif %}

This code is within a standard page.html.twig template.

Sorry if this is a silly question, but we all need to start somewhere...

Thank you

Luca

neting.it
  • 35
  • 1
  • 5

1 Answers1

2

There is no site_logo variable in page.html.twig, if you wish to customize site_logo you can use block--system-branding-block.html.twig

Rotari Radu
  • 645
  • 6
  • 13