Add option to hide modular pages in parent select (#1571)

This commit is contained in:
Thomas Vantuycom
2019-01-15 01:01:16 +00:00
committed by Andy Miller
parent 4d5eb659c0
commit ffe08b0bff
2 changed files with 19 additions and 1 deletions

View File

@@ -162,6 +162,18 @@ form:
label: Parents Levels
size: small
help: The number of levels to show in parent select list
pages.show_modular:
type: toggle
label: Modular parents
hightlight: 1
default: 1
options:
1: PLUGIN_ADMIN.ENABLED
0: PLUGIN_ADMIN.DISABLED
validate:
type: bool
help: Show modular pages in the parent select list
google_fonts:
type: toggle

View File

@@ -4,6 +4,7 @@
{% set last_page_route = admin.page.getLastPageRoute %}
{% set show_slug_val = true %}
{% set show_fullpath_val = false %}
{% set show_all_val = true %}
{% set show_parents = config.get('plugins.admin.pages.show_parents') %}
{% if show_parents == 'folder' %}
@@ -14,7 +15,12 @@
{% set limit_levels_val = config.get('plugins.admin.pages.parents_levels') %}
{% set defaults = {show_root:true, show_all:true, show_slug:show_slug_val, show_fullpath:show_fullpath_val, default:last_page_route, limit_levels:limit_levels_val} %}
{% set show_modular_val = config.get('plugins.admin.pages.show_modular') %}
{% if show_modular_val == false %}
{% set show_all_val = false %}
{% endif %}
{% set defaults = {show_root:true, show_all:show_all_val, show_modular:show_modular_val, show_slug:show_slug_val, show_fullpath:show_fullpath_val, default:last_page_route, limit_levels:limit_levels_val} %}
{% set field = field|merge(defaults) %}
{{ parent() }}
{% endblock %}