Add textfield to system branding block form to specify link URL I would like to alter the branding block to add a textfield in the block form to specify the URL it should redirect to. The URL is currently fixed to &lt;front&gt; in the Twig template.

What I've done so far is to add the text field with hook_form_alter. I'm saving the value using $form['entity_builders'] and $block-&gt;setThirdPartySetting. This works.

I want to retrieve this value in hook_preprocess_block__system_branding_block(&amp;$variables) but $variables does not contain the block entity. How can I get the block in this preprocess function so that I can load my added value with $block-&gt;getThirdPartySetting?
A different approach: You can override the system branding block template via the block--system-branding-block.html.twig file (instead of using a preprocess hook).

On a Bootstrap theme, block--system-branding-block.html.twig looks like this:

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


You can alter the href of those links to point anywhere you'd like, for example:

&lt;a class="logo navbar-btn pull-left" href="/some/other/page" title="{{ 'Home'|t }}" rel="home"&gt;&lt;src="{{ site_logo }}" alt="{{ 'Home'|t }}" /&gt;&lt;/a&gt;