Skip to content
Grav 2.0 is officially stable. Read the announcement →

Community guidelines

Please keep discussions civil and on-topic. Repeated violations may lead to a temporary ban.

Archive

{{ base_url_relative}} is empty

Started by Muut Archive 12 years ago · 14 replies · 716 views
12 years ago

Try doing a clear-cache. That value should be automatically generated now based on your server environment Grav 0.9.6. You may have that configuration cached.

12 years ago

BTW, your site is looking for for me. Any specific issue you are seeing?

12 years ago

cach is emptied, behavior remains the same.

12 years ago

Please try to be descriptive as possible so I can determine what the issue is.

12 years ago

<a href="{{ base_url_relative}}">{{ config.site.title }}</a> from base.html.twig is empty when I open the page in a browser: <header id="header">

HTML
            <div id="logo">
                <h3><a href="">Daniel Hamann</a></h3>
            </div>
            <div id="navbar">
12 years ago

Ok, so your expecting base_url_relative be / and it is infact ``. Got it.

I shall look into this. We did change where the base_url was being set, and this might of effected it, but I'll have to debug it. Thanks.

12 years ago

thx, so far nice work - Grav is wonderful !

12 years ago

Ok, had to dig through some commits to work out what's going on here. Actually in your instance base_url_relative is intentionally empty, because your are not running in a sub-folder. However the problem lies in the fact that I erroneously changed the Antimatter theme to use relative, when it was using base_url_absolute before. I will revert that change to the Anitmatte, but you can just fix it by changing it in your theme: user/themes/antimatter/templates/partials/base.html.twig

12 years ago

Actually on further reflection, I'm just going to update Antimatter with a check to see if the base_url (same as base_url_relative by default) is empty, then i'll add a / else it will use base_url:

TWIG
<h3><a href="{{ base_url == '' ? '/' : base_url }}">{{ config.site.title }}</a></h3>

Not quite as clean, but this is safer and more descriptive.

Suggested topics

Topic Participants Replies Views Activity
Archive · by Deleted User, 9 years ago
0 1282 9 years ago
Archive · by Muut Archive, 9 years ago
2 889 9 years ago
Archive · by Muut Archive, 9 years ago
2 4019 9 years ago
Archive · by Muut Archive, 9 years ago
1 2894 9 years ago
Archive · by Muut Archive, 9 years ago
3 1078 9 years ago