Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Limit Parents Levels #1298

Merged
merged 2 commits into from
Jan 19, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions blueprints.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,12 @@ form:
folder: Show folder
fullpath: Show fullpath

pages.parents_levels:
type: text
label: Parents Levels
size: small
help: The number of levels to show in parent select list

google_fonts:
type: toggle
label: Use Google Fonts
Expand Down
4 changes: 3 additions & 1 deletion themes/grav/templates/forms/fields/parents/parents.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,10 @@
{% elseif show_parents == 'fullpath' %}
{% set show_fullpath_val = true %}
{% endif %}

{% 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} %}
{% 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 field = field|merge(defaults) %}
{{ parent() }}
{% endblock %}