Skip to content
● Meet Grav Guard: keep every Grav site you run secure and up to date, all from one place. Free for up to 3 sites. Read more →

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

Solved by Sumpuran View solution

Started by Sumpuran 7 years ago · 1 replies · 1196 views
7 years ago

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).

Screen Shot 2020-01-27 at 7.09.55 PM|657x500

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

HTML
<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:

TWIG
{% 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).

last edited 01/27/20 by Sumpuran

Suggested topics

Topic Participants Replies Views Activity
Themes & Styling · by MarkP, 2 weeks ago
3 193 2 weeks ago
Themes & Styling · by TomW, 2 weeks ago
0 111 2 weeks ago
Themes & Styling · by themetman, 3 weeks ago
1 206 3 weeks ago
Themes & Styling · by AH, 1 month ago
1 324 3 weeks ago
Themes & Styling · by Bruno, 4 years ago
6 1523 3 weeks ago