Added option to control how parents select displays

This commit is contained in:
Andy Miller
2017-05-29 14:36:01 -06:00
parent 472d27bf41
commit fcbc2ed992
3 changed files with 23 additions and 1 deletions

View File

@@ -17,6 +17,8 @@ widgets:
dashboard-notifications: true
dashboard-feed: true
dashboard-pages: true
pages:
show_parents: both
session:
timeout: 1800
warnings:

View File

@@ -136,6 +136,16 @@ form:
frontend_tab: Separate tab (always the same)
_self: Current tab
pages.show_parents:
type: select
size: medium
label: Parent dropdown
highlight: 1
options:
both: Show slug and folder
folder: Show folder
fullpath: Show fullpath
google_fonts:
type: toggle
label: Use Google Fonts

View File

@@ -2,7 +2,17 @@
{% block input %}
{% set last_page_route = admin.page.getLastPageRoute %}
{% set defaults = {show_root:true, show_all:true, show_slug:true, default:last_page_route} %}
{% set show_slug_val = true %}
{% set show_fullpath_val = false %}
{% set show_parents = config.get('plugins.admin.pages.show_parents') %}
{% if show_parents == 'folder' %}
{% set show_slug_val = false %}
{% elseif show_parents == 'fullpath' %}
{% set show_fullpath_val = true %}
{% endif %}
{% set defaults = {show_root:true, show_all:true, show_slug:show_slug_val, show_fullpath:show_fullpath_val, default:last_page_route} %}
{% set field = field|merge(defaults) %}
{{ parent() }}
{% endblock %}