craft-preparse-field icon indicating copy to clipboard operation
craft-preparse-field copied to clipboard

Look into validating twig content in preparse field settings

Open jalendport opened this issue 2 years ago • 1 comments

From Andrew Welch:

Jalen, feel free to steal if it helps: https://github.com/nystudio107/craft-seomatic/blob/develop/src/validators/TwigExpressionValidator.php -- it renders the Twig code, and adds any errors to the model. You just add the TwigExpressionValidator to the model fields that need it: https://github.com/nystudio107/craft-seomatic/blob/develop/src/models/MetaScript.php#L188

jalendport avatar Oct 27 '21 01:10 jalendport

Even better now: https://github.com/nystudio107/craft-twigfield#twig-template-validators

khalwat avatar Aug 08 '22 21:08 khalwat