Skip to content
Grav 2.0 is officially stable. Read the announcement →

Community guidelines

Please keep discussions civil and on-topic. Repeated violations may lead to a temporary ban.

Support

Slug validation rule fails in default.yaml - bug?

form

Started by Nick 8 years ago · 4 replies · 747 views
8 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

8 years ago

But the rule doesn't work...

8 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 Thomas, 1 week ago
2 56 13 hours ago
Support · by Anna, 3 days ago
2 61 16 hours ago
Support · by Justin Young, 17 hours ago
1 32 17 hours ago
Support · by Duc , 1 week ago
2 66 5 days ago
Support · by Colin Hume, 1 week ago
2 59 5 days ago