Hi
Is there a way to limit the number of chars on an existing field in umbraco?
I am looking for something that will limit the number of chars on the text string and will notify the user on error and can be adjusted:
Even if I have the same text string property on different fields I will be able to give a different limit to each one.
There also once was a nice blogpost by Mark Drake about how to create your own texstring / textbox property editor with character limitations where the color would change from green to yellow and then to red depending on how many characters were wridden. But it seems he has deleted / removed the blogpost unfortunately. But the repository is still on github here https://github.com/markadrake/Umbraco-Property-Editors/tree/master/App_Plugins/propertyeditors
The comments for the blogpost stille exists but the link is giving a 404 unfortunately but perhaps Google's cache or the way back machine can help https://disqus.com/home/discussion/markdrake/customumbracopropertyeditortutorialcharactercounts/best/
Does this help?
You would of course need to create different instances if you need different character limitations.
Thanks
Because my client has entered his content to the property editor, I am afraid that changing the property fields will erase his content.
Is there a way to build something that can be applied to existing properties?
Creating char limit in text fields
Hi Is there a way to limit the number of chars on an existing field in umbraco? I am looking for something that will limit the number of chars on the text string and will notify the user on error and can be adjusted:
Even if I have the same text string property on different fields I will be able to give a different limit to each one.
Hi Moran
Something like this? https://our.umbraco.org/projects/backoffice-extensions/kraftvaerkmaxlength/
There also once was a nice blogpost by Mark Drake about how to create your own texstring / textbox property editor with character limitations where the color would change from green to yellow and then to red depending on how many characters were wridden. But it seems he has deleted / removed the blogpost unfortunately. But the repository is still on github here https://github.com/markadrake/Umbraco-Property-Editors/tree/master/App_Plugins/propertyeditors
The comments for the blogpost stille exists but the link is giving a 404 unfortunately but perhaps Google's cache or the way back machine can help https://disqus.com/home/discussion/markdrake/customumbracopropertyeditortutorialcharactercounts/best/
Does this help?
You would of course need to create different instances if you need different character limitations.
/Jan
Thanks Because my client has entered his content to the property editor, I am afraid that changing the property fields will erase his content. Is there a way to build something that can be applied to existing properties?
If the existing property editor stores text then you can swap with any new editor that also stores text.
Hi Moran,
I think you can use content service events, specially "Saving" event. You can check document type, property type, property value there.
Related doc : https://our.umbraco.org/documentation/reference/events/contentservice-events
Sample links:
http://www.codeshare.co.uk/blog/intercepting-content-and-member-save-events-in-umbraco/
https://github.com/jbreuer/Hybrid-Framework-for-Umbraco-v7-Best-Practises/blob/master/Umbraco.Extensions/Events/UmbracoEvents.cs
is working on a reply...