Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
My questions maybe are easy to answer but I haven't been able to find the solutions so far.
1. I'm trying to include a file name validator for Media Picker. Currently I added a regex expression to validate the file name but the validator isn't fired.
2. I'd like to validate a text field which must be unique between nodes. I don't have a clear approach to do it, could anyone help me with it?
Hi Vicente and welcome to our :)
Are you trying to expand the fucntionality of Umbraco using your own datatype? Or do I misunderstand?
You should be able to simply define some regex when you define the properties of your document type.
Btw what version of Umbraco are you using?
Sorry, I was in a rush on Thursday and I didn't give all the information I should.
Jan, I'm using the Media Picker, not a custom control. I tried using some regex but any of them was use it.
About my second question. I'm using a umbracoUrlAlias and I'd like to check that is unique between the pages. Is it possible?
I'm using Umbraco 4.7.2
Hi Vicente, not really sure you can do the first item because when you save the page the media picker only stores the ID of the associated media item.
What i would look to do is create an extension which fires when you click publish (or save), you would need to create a class that inherits from IApplicationEventHandler and then in the inherited methods you can do something like
public void OnApplicationStarting(UmbracoApplication httpApplication, ApplicationContext applicationContext)
Document.AfterSave += Document_AfterSave;
where the Document_AfterSave mehtod is your own code which does the checking, take a look at
hope that helps
is working on a reply...
Write your reply to:
Image will be uploaded when post is submitted