What values can this be set to please, and is it only for the main editor or can it be applied to the prevalue editors/views?
As I would ideally like to make one of my prevalues on my property editor (data type) a required field, otherwise the property editor is not valid & cannot be saved.
Manifest declared validators are for server-side validation without you having to write any c#, if you require more complex server side validation then you will need to write a c# property editor.
Remember - client side validation is not enough; if you absolutely require your values to be validated, then you need to use server side, otherwise malicious people could send whatever data they want to store in your property.
Feel free to update our documentation with this information if you like :)
Hey Shannon,
Thanks for letting me know about this and what ones are available to us package developers to use out of the box with Umbraco.
Yes I would like to document this, just need to find the time to do it & find out how the Belle docs work etc...
Is it possible to write my own custom ManifestValueValidator for my own package that I am writing?
I want to ensue the JSON data it saves as a prevalue (YouTube Username, YouTube Weird Channel GUID, YouTube Channel Logo) exists & has values & I presume the rewuired one that Umbraco ships with will just check a simple string, rather than a JSON object that I will save back to Umbraco as a PreValue?
Don't worry about documenting with the Belle docs - these will ONLY be used for API docs eventually which are auto generated. Everything else goes into the normal Our docs and everything apart from the API docs will be removed from the Belle docs.
No, you cannot create custom manifest value validators. If you need more control over all of the data that is saved for your property editor, you will need to create a c# property editor. You can do whatever you like with a c# property editor including custom validation, control exactly what data is stored, etc...
OK I will add them into the normal Our docs about the package.manifest and these out of the box validators for the editors or prevalue editors.
I don't want to validate the main property editor with this method, but a prevalue editor instead & I was hoping I could create a custom one of these classes to use with my prevalue.
Doesn't matter if it is a pre-value editor or the main property editor - they are both part a 'Property Editor' construct in c#. It is extremely easy to make a c# property editor - it would be basically the same amount of code to create a custom manifest validator in c# as to create a custom property editor in c#. There's plenty of examples in the core.
OK can you point me in the right direction about C# property editors/prevalue editors please, as I still find the core source base a BIG and scary base and not knowing where to look is half the battle I normally have.
V7 package.manifest validation array
Hello all
I am working on a new property editor for Umbraco 7, I noticed there is a validation object in the package.manifest
http://umbraco.github.io/Belle/#/tutorials/manifest
What values can this be set to please, and is it only for the main editor or can it be applied to the prevalue editors/views?
As I would ideally like to make one of my prevalues on my property editor (data type) a required field, otherwise the property editor is not valid & cannot be saved.
I look forward to hearing back & learning more.
Thanks,
Warren :)
Hi Warren
Do you mean somethink like:
http://www.nibble.be/?p=377
Yes thanks that did help and was what I was after for now.
I have seen this example of multiple validation type's, however I am curious to know what other types & values this validation object can be
And this other one I found as well:
Manifest declared validators are for server-side validation without you having to write any c#, if you require more complex server side validation then you will need to write a c# property editor.
Manifest validators are implementations of:
https://github.com/umbraco/Umbraco-CMS/blob/7.1.5/src/Umbraco.Core/PropertyEditors/ManifestValueValidator.cs
Here's all of the current implementations:
Remember - client side validation is not enough; if you absolutely require your values to be validated, then you need to use server side, otherwise malicious people could send whatever data they want to store in your property.
Feel free to update our documentation with this information if you like :)
Hey Shannon,
Thanks for letting me know about this and what ones are available to us package developers to use out of the box with Umbraco.
Yes I would like to document this, just need to find the time to do it & find out how the Belle docs work etc...
Is it possible to write my own custom ManifestValueValidator for my own package that I am writing? I want to ensue the JSON data it saves as a prevalue (YouTube Username, YouTube Weird Channel GUID, YouTube Channel Logo) exists & has values & I presume the rewuired one that Umbraco ships with will just check a simple string, rather than a JSON object that I will save back to Umbraco as a PreValue?
Thanks,
Warren
Don't worry about documenting with the Belle docs - these will ONLY be used for API docs eventually which are auto generated. Everything else goes into the normal Our docs and everything apart from the API docs will be removed from the Belle docs.
No, you cannot create custom manifest value validators. If you need more control over all of the data that is saved for your property editor, you will need to create a c# property editor. You can do whatever you like with a c# property editor including custom validation, control exactly what data is stored, etc...
OK I will add them into the normal Our docs about the package.manifest and these out of the box validators for the editors or prevalue editors.
I don't want to validate the main property editor with this method, but a prevalue editor instead & I was hoping I could create a custom one of these classes to use with my prevalue.
Cheers,
Warren
Doesn't matter if it is a pre-value editor or the main property editor - they are both part a 'Property Editor' construct in c#. It is extremely easy to make a c# property editor - it would be basically the same amount of code to create a custom manifest validator in c# as to create a custom property editor in c#. There's plenty of examples in the core.
OK can you point me in the right direction about C# property editors/prevalue editors please, as I still find the core source base a BIG and scary base and not knowing where to look is half the battle I normally have.
Thanks,
Warren :)
They are all found here:
https://github.com/umbraco/Umbraco-CMS/tree/7.1.5/src/Umbraco.Web/PropertyEditors
Thanks your a legend!
Hello,
The url above doesn't seem to work any longer:
https://github.com/umbraco/Umbraco-CMS/tree/7.1.5/src/Umbraco.Web/PropertyEditors
Is there another the "C# Property Editor" guides our there?
This is the source:
https://github.com/umbraco/Umbraco-CMS/tree/dev-v7/src/Umbraco.Web/PropertyEditors
Here are the docs:
https://our.umbraco.org/documentation/Extending/Property-Editors/
is working on a reply...