Skip to content
Grav 2.1 is out: every page speaks Markdown. Read the announcement →

Slug validation rule fails in default.yaml - bug?

form

Started by Nick 9 years ago · 4 replies · 903 views
9 years ago
YAML
                    folder:
                      type: text
                      label: PLUGIN_ADMIN.FOLDER_NAME
                      validate:
#                        rule: slug
                        pattern: '[a-zA-Zа-яA-Я0-9_\-]+'
                        min: 1
                        max: 200

rule: slug doesn't appear to be being parsed. If I copy pattern etc from the top of the file, it works as expected. If I inherit default.yaml in theme blueprints no validation will take place.

Is this a bug?

Cheers, Nick

9 years ago

But the rule doesn't work...

9 years ago

Hmm.. try this to reference it in the field:

YAML
            validate:
                required: true
                rule: slug

If this works, we have a typo in the docs.

Suggested topics

Topic Participants Replies Views Activity
Support · by complanar, 6 days ago
6 143 19 hours ago
Support · by Rick Beebe, 6 days ago
2 101 3 days ago
Support · by blu3prince, 3 days ago
0 53 3 days ago
Support · by alex, 4 days ago
2 94 3 days ago
Support · by Marcel, 2 weeks ago
1 144 4 days ago