You'll have to create a custom field type. There's a project in the projects section that has the source for the built in ones: http://our.umbraco.org/projects/developer-tools/umbraco-contour-shared-source if you have a look through those, it should give you an idea of how to create your own. You could have a look at the source of the Umbraco DataType for limited fields: http://our.umbraco.org/projects/backoffice-extensions/char-limit (no source posted, you'll need to use Reflector or similar to get the source) and use that to with the other code to roll your own character limited field.
Hi Tim, thank you for your reply. As you'll see, I'm discovering umbraco and contour. So, with the contour shared source I created a cs file (LimitedTextarea.cs) to suit my needs. But now, what do I do with the .cs file? Do I need to compile something or just drop it in some folder?
Yes, you need to add your new class (based on the class from the shared source project) into a new class project and compile it into a DLL. Did you develop code to restrict the number of entered characters? If not the source code to the Umbraco limited character datatype mentioned by Tim above can be downloaded here This should help in developing the Contour field type.
Hi Jeavon! Since I need to compile DLL and I don't know how, I just used regex to limit character and add tooltip to say :"eh, you have 200 characters!". But thank you for your help
Contour field type who displays remaining character
Hi guys,
I'm kind a new with Contour and I want to do a textarea field type who will display the character limit and how many remaining character.
For now, I just use a textarea and limit it with regex, but I want the user to be able so see how many character remain.
Thank you for your help
You'll have to create a custom field type. There's a project in the projects section that has the source for the built in ones: http://our.umbraco.org/projects/developer-tools/umbraco-contour-shared-source if you have a look through those, it should give you an idea of how to create your own. You could have a look at the source of the Umbraco DataType for limited fields: http://our.umbraco.org/projects/backoffice-extensions/char-limit (no source posted, you'll need to use Reflector or similar to get the source) and use that to with the other code to roll your own character limited field.
Hope that helps!
:)
Hi Tim, thank you for your reply. As you'll see, I'm discovering umbraco and contour. So, with the contour shared source I created a cs file (LimitedTextarea.cs) to suit my needs. But now, what do I do with the .cs file? Do I need to compile something or just drop it in some folder?
Hi,
Yes, you need to add your new class (based on the class from the shared source project) into a new class project and compile it into a DLL. Did you develop code to restrict the number of entered characters? If not the source code to the Umbraco limited character datatype mentioned by Tim above can be downloaded here This should help in developing the Contour field type.
Thanks,
Jeavon
Hi Jeavon! Since I need to compile DLL and I don't know how, I just used regex to limit character and add tooltip to say :"eh, you have 200 characters!". But thank you for your help
is working on a reply...