Files
sm-menu-plugin/models/menuentry/fields.yaml
Jakub Zych 08f99b8aad feat(17-04): menu plugin admin with registry types, URL checks and tree reorder
- golem15.menu plugin, tables golem15_menu_menus and golem15_menu_menu_entries with the PHP columns plus a nullable url_pattern (D-02)
- MenuEntry BeforeSave ports PHP beforeSave: nest columns 0, menu from the parent, sort_order after the menu's last
- entry type dropdown: url, divider and the signpost registry types; reference depends on type through signpost.ReferenceOptions
- URL scheme allowlist (errors.url_scheme), target _self or _blank, menu and parent cycle checks
- menu filter, toolbar reorder/create/delete and config_reorder.yaml partitioned by menu
- navigation Menus with Menus and Menu entries, permission golem15.menu.manage_menu, en and pl phrasebooks
- TestMenuAdminSmoke
2026-10-12 17:30:50 +02:00

78 lines
2.4 KiB
YAML

# ===================================
# Form Field Definitions
# ===================================
#
# Adapted from the WinterCMS form: the "Menu Entry Options" tab is flattened,
# the "Children" tab and partial are gone (the reorder page replaces them),
# menu is a relation field (it is also the reorder partition), the type
# options are the built-ins plus the registry types, and reference,
# url_pattern and target are new.
fields:
menu:
label: golem15.menu::lang.models.menuentry.menu
comment: golem15.menu::lang.models.menuentry.menu_comment
type: relation
nameFrom: name
span: full
parent:
label: golem15.menu::lang.models.menuentry.parent
type: relation
nameFrom: title
emptyOption: backend::lang.form.none
span: left
type:
label: golem15.menu::lang.models.menuentry.type
type: dropdown
options: getTypeOptions
default: url
required: true
span: right
title:
label: golem15.menu::lang.models.menuentry.title
type: text
span: left
url:
label: golem15.menu::lang.models.menuentry.url
comment: golem15.menu::lang.models.menuentry.url_comment
type: text
span: right
reference:
label: golem15.menu::lang.models.menuentry.reference
comment: golem15.menu::lang.models.menuentry.reference_comment
type: dropdown
dependsOn: type
emptyOption: backend::lang.form.none
span: left
url_pattern:
label: golem15.menu::lang.models.menuentry.url_pattern
comment: golem15.menu::lang.models.menuentry.url_pattern_comment
type: text
span: right
code:
label: golem15.menu::lang.models.menuentry.code
type: text
span: left
icon:
label: golem15.menu::lang.models.menuentry.icon
type: text
span: right
css_class:
label: golem15.menu::lang.models.menuentry.css_class
type: text
span: left
target:
label: golem15.menu::lang.models.menuentry.target
type: dropdown
default: _self
span: right
options:
_self: golem15.menu::lang.models.menuentry.target_self
_blank: golem15.menu::lang.models.menuentry.target_blank
is_published:
label: golem15.menu::lang.models.menuentry.is_published
type: switch
default: true
context: update
span: left