Skip to content

Instantly share code, notes, and snippets.

@davebeach
Created September 5, 2016 07:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save davebeach/3df1151ee911f985fe7ad002035db488 to your computer and use it in GitHub Desktop.
Save davebeach/3df1151ee911f985fe7ad002035db488 to your computer and use it in GitHub Desktop.
Drupal 8 SVG Logo TWIG Branding Block
{# The easiest way to add link to home page and SVG logo is to put the SVG into the active theme directory root named logo.svg. To have default for browsers that cannot display SVG, see GIST https://gist.github.com/davebeach/064996d9b234c742642f8ca45585139a - then in the twig block just add the anchor and image elements. There is a lot of complex settings, by passing the block further down to another content file, but this makes no sense. The most difficult part is the anchor link, which just set it to /, don't try and is_front until the bugs are worked out with that functionality. #}
{% block content %}
<div class="container-content region-fixed-content">
<a class="logo" href="{{ '/' | page }}">
<img src="{{ logo }}" alt="{{ 'Home'|t }}"/>
</a>
</div>
{% endblock %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment