mirror of
https://github.com/getgrav/grav-plugin-admin.git
synced 2026-01-10 17:43:04 +01:00
Added option to control how parents select displays
This commit is contained in:
@@ -17,6 +17,8 @@ widgets:
|
||||
dashboard-notifications: true
|
||||
dashboard-feed: true
|
||||
dashboard-pages: true
|
||||
pages:
|
||||
show_parents: both
|
||||
session:
|
||||
timeout: 1800
|
||||
warnings:
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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 %}
|
||||
|
||||
Reference in New Issue
Block a user