summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIgor Scheller <igor.scheller@igorshp.de>2019-12-28 21:46:52 +0100
committerIgor Scheller <igor.scheller@igorshp.de>2019-12-28 21:46:52 +0100
commite4a06fb45743dbea048778fab2a95f274c3f81bb (patch)
tree57a0a2e11b9931d2a1fff81c01de91dccf07eb96
parentb3a4c67b1b193d4846ece51ecce1fcc914f09b83 (diff)
Header: Add external links
-rw-r--r--config/config.default.php6
-rw-r--r--resources/views/layouts/parts/navbar.twig12
2 files changed, 18 insertions, 0 deletions
diff --git a/config/config.default.php b/config/config.default.php
index 9b93eb25..5b146553 100644
--- a/config/config.default.php
+++ b/config/config.default.php
@@ -23,6 +23,12 @@ return [
// Set to development to enable debugging messages
'environment' => env('ENVIRONMENT', 'production'),
+ // Header links
+ // Available link placeholders: %lang%
+ 'header_items' => [
+ //'Foo' => 'https://foo.bar/batz-%lang%.html',
+ ],
+
// Footer links
'footer_items' => [
// URL to the angel faq and job description
diff --git a/resources/views/layouts/parts/navbar.twig b/resources/views/layouts/parts/navbar.twig
index 9045601b..d5bd4fec 100644
--- a/resources/views/layouts/parts/navbar.twig
+++ b/resources/views/layouts/parts/navbar.twig
@@ -28,6 +28,18 @@
<div class="collapse navbar-collapse" id="navbar-collapse-1">
{% block menu_items %}
{{ menu() }}
+
+ {% if config('header_items') %}
+ <ul class="nav navbar-nav">
+ {% for text,link in config('header_items', {}) %}
+ <li>
+ <a href="{{ link|replace({'%lang%': session_get('locale')|split('_')[0]})|escape('html_attr') }}">
+ {{ text }}
+ </a>
+ </li>
+ {% endfor %}
+ </ul>
+ {% endif %}
{% endblock %}
{% block menu_toolbar %}