Add validation to page attribute

Permalink
Hello!

I'd like to have a limit on how long the text can be for a certain page attribute and then have some error message pop up if the text is too long. This is easy to do for block forms but I have no idea how I do this for attributes. I'm not sure if the attribute is a custom made or not, it's called meta_description.

View Replies:
MrKDilkington replied on at Permalink Reply
MrKDilkington
Hi pat101,

The Meta Description attribute is a textarea attribute type.

You might be able to override the textarea attribute type to add a string length validation that can be set per attribute.
https://documentation.concrete5.org/tutorials/override-almost-any-co...
https://documentation.concrete5.org/developers/attributes/validating...

The other option might be to fork the the textarea attribute type and hard code the validation or add the per attribute string length validation.