I want to avoid leading numbers in the title field of a subpage,
so I created a custom validator:
Plugin:
v::$validators['denyLeadingNum'] = function($value) {
return preg_match('/^\d+/', $value) < 1 ?? false;
};
Blueprint:
title:
label: Titel
type: text
validate: denyLeadingNum
It works fine, as long as I edit the title of a page,
but when I create a new page from a parent page, it’s no problem
to enter leading numbers. The page will be created anyway.
Is there a way to validate the title when creating a new page?
Thank You!