How to create a link from the site icon to the base URL (in Mediator 1.0.2)

I’m using the Mediator 1.0.2 skeleton and theme. It has an icon in the top-left corner, of which one would think that, once clicked, one would end up on the home page. Instead, it just reloads the same page. This is true for both the blog and the about sections (so, all the sections I currently have).

If I inspect the element in my browser, it shows up as not having an URL filled in.

<a href="" class="logo-readium"><span class="logo" style="background-image: url(/user/images/logo.jpg)"></span></a>

I searched for mentions of ‘logo-readium’ in the user files. The file base.html.twig has:

{% set home = pages.find(config.system.home.alias) %}

{% block header %}
    <a href="{{ base_url_relative }}" class="logo-readium"><span class="logo" style="background-image: url({{ base_url_relative }}{{ site.logo }})"></span></a>
{% endblock %}

From what I read in the docs, that should link to the home page.

The {{ base_url_relative }} returns the base URL to the Grav site, without the host information page.

But in my case, it doesn’t do that, no link is created. So when clicked, it just reloads the page. I already tried changing it to ‘base_url’, but that didn’t have any effect.

In which file would I make edits so that all pages link that icon to the home page?

Shout-out to @pamtbaau, who figured out the answer to my previous question (about using the same ancient theme).

OK, I got it to work.

In the past, there was a thread about this topic. Logo image not redirecting to homepage

Apparently, on Github, a solution was provided, but it never made it into a release.

The solution provided worked like a charm.

1 Like