Added an option for opening frontend pages in a new tab, in a separate tab (always the same) or in the current tab. (#1096)

This commit is contained in:
Philippe
2017-04-28 15:49:20 -04:00
committed by Andy Miller
parent e5d1e60234
commit e1f0786fb0
3 changed files with 13 additions and 3 deletions

View File

@@ -22,6 +22,7 @@ session:
warnings:
delete_page: true
edit_mode: normal
frontend_pages_target: _blank
show_github_msg: true
google_fonts: true
enable_auto_updates_check: true

View File

@@ -125,6 +125,16 @@ form:
expert: Expert
help: Auto will use blueprint if available, if none found, it will use "Expert" mode.
frontend_pages_target:
type: select
label: Open frontend pages in
size: medium
default: _blank
options:
_blank: New tab
frontend_tab: Separate tab (always the same)
_self: Current tab
google_fonts:
type: toggle
label: Use Google Fonts
@@ -354,5 +364,3 @@ form:
type: hidden
label: Visitors history
default: 20

View File

@@ -42,7 +42,8 @@
{% endblock %}
{% set preview_html = (base_url_relative_frontend|rtrim('/') ~ (context.home ? '' : context.route)) ?: '/' %}
{% set preview_link = context.routable ? '<a class="button" target="_blank" href="' ~ preview_html ~ '"> <i class="fa fa-fw fa-eye" style="font-size:18px;margin-right:0;"></i></a>' : '' %}
{% set preview_target = config.plugins.admin.frontend_pages_target %}
{% set preview_link = context.routable ? '<a class="button" target="' ~ preview_target ~ '" href="' ~ preview_html ~ '"> <i class="fa fa-fw fa-eye" style="font-size:18px;margin-right:0;"></i></a>' : '' %}
{% macro loop(page, depth, twig_vars) %}
{% set separator = twig_vars['config'].system.param_sep %}