Skip to content
This repository has been archived by the owner on Mar 31, 2023. It is now read-only.

Issue with logo #340

Open
sinyayadynya opened this issue May 17, 2019 · 1 comment
Open

Issue with logo #340

sinyayadynya opened this issue May 17, 2019 · 1 comment

Comments

@sinyayadynya
Copy link

emulsify version: 3.1
node version: 8.11.1
yarn version: 1.12.3

I'm still fighting with the logo, as until now I was using a work around to include the Drupal branding block. However, I thought that the logo should be managed with the branding block disable and simply through the site-header.twig file:

 <header class="header">
  {% block header_content %}
    {% include "@atoms/04-images/00-image/figure.twig" with {
      img_src: '../../images/logo.svg',
      img_alt: 'Logo',
      img_url: logo_link_url|default('/'),
      image_figure_base_class: 'logo',
      image_link_blockname: 'logo',
    } %}
    {% include "@molecules/menus/main-menu/main-menu.twig" %}
  {% endblock %}
</header>

But this is not working and I'm wondering why. With my Drupal branding block enable, the logo is not linked to the frontpage, and if I disabled it, then I have no more logo.

Any help to understand this would be welcome.

@jfitzsimmons2
Copy link

Just ran into a similar issue.

Within your Drupal header template file (region--header.html.twig), {% block header_content %} is likely being overwritten by the image component which can not handle links so it is not using the figure component which can handle links.

So with your Drupal branding block, that is probably using components/_patterns/01-atoms/04-images/00-image/_image.twig to render the logo, which doesn't know what to do with img_url, so that's why it's not being linked.

I modified components/_patterns/01-atoms/04-images/00-image/_image.twig to include some code that checked for img_url, similarly to how the figure component works and my site had my branding block linked properly.

Hope that helps.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants