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.

General

How to make the footer open a new page

Solved by Harald Schneider View solution

Started by David Jakob 6 years ago · 2 replies · 1044 views
6 years ago

Hi folks - just installed Grav with the Blog Skeleton. There are links in the footer leading to Grav and Trilby Media. I'm more than happy to leave the credits, but I really want them to open in a new page and not replace my site.
I've looked at the code which includes target=_blank, but the don't open in a new page. Any ideas what I have to change? Here's what I found:

{% if custom_admin_footer %}
{{ custom_admin_footer|raw }}
{% else %}
<a href="http://getgrav.org/" target="_blank" rel="noopener noreferrer">Grav</a> v<span class="grav-version">{{ constant('GRAV_VERSION') }}</span> - Admin v{{ admin_version }} - {{ "PLUGIN_ADMIN.WAS_MADE_WITH"|tu|lower }} <i class="fa fa-heart-o pulse"></i> {{ "PLUGIN_ADMIN.BY"|tu|lower }} <a href="https://trilby.media/" target="_blank" rel="noopener noreferrer">Trilby Media</a>.
{% endif %}

Appreciate any help.

6 years ago Solution

You reference the footer of the admin backend. I assume, you want to change the footer of the template frontend. For this, you need to change the following file:

/user/themes/THEME-NAME/templates/partials/footer.html.twig

Just replace the link variable with plain HTML, as you desire. E.g.

TWIG
{# Render the backtotop link #}
{% if config.plugins.backtotop.enabled %}
    {% include 'partials/backtotop.html.twig' %}
{% endif %}
<section id="footer" class="section bg-gray">
    <section class="container {{ grid_size }}">
        <p><i class="fa fa-code"></i> with <i class="fa fa-heart-o pulse "></i> by <a href="https://marketmix.com" target="_blank">Harald Schneider Software & Mediadesign</a>.</p>
    </section>
</section>
last edited 02/09/20 by Harald Schneider
6 years ago

You're a hero! Thanks. It was even easier - my mistake was to look in the wrong place - as you suspected, I was looking at the backend footer.

Your help is much appreciated!

Suggested topics

Topic Participants Replies Views Activity
General · by Jerry Hunt, 4 days ago
2 80 9 hours ago
General · by pamtbaau, 14 hours ago
1 51 14 hours ago
General · by Andy Miller, 1 day ago
0 44 1 day ago
General · by Marcel, 12 months ago
6 346 5 days ago
General · by Duc , 5 days ago
3 40 5 days ago