Hi,
I have a pathfield, i need to limit the type of the files to .jpeg.
I can't find the right property.
Thanks
Solved! Go to Solution.
Views
Replies
Total Likes
Simple approach would be to use regex. Please use this code and keep all extension you want or add or remove
regex :/\.(png|jpg|jpeg)$/, regexText : "Please choose an correct file"
Views
Replies
Total Likes
See the reference doc
ttps://docs.adobe.com/content/docs/en/cq/5-6-1/widgets-api/?class=CQ.form.PathField
Views
Replies
Total Likes
Yes but i cannot find the property
I have tried with linkPattern but doesn't work
Views
Replies
Total Likes
ANother way to perform this use case is to write a custom predicate. See this community article:
Views
Replies
Total Likes
Simple approach would be to use regex. Please use this code and keep all extension you want or add or remove
regex :/\.(png|jpg|jpeg)$/, regexText : "Please choose an correct file"
Views
Replies
Total Likes
Hi
Please go through the documentation of "CQ.form.PathField",
Link:- https://docs.adobe.com/docs/en/cq/5-6/widgets-api/index.html?class=CQ.form.PathField
You can use :
regex :
linkPattern : String
parLinkPattern : String
As mentioned by Scott, you would need to write custom pathfield,
Pathfield has a property called predicate which can be used for filtering. You can create and register a custom predicate that returns false for the paths you don't want to be visible in the the dialog. The name of the custom predicate can then be passed to the config of pathfield.
You can find information here : http://wemcode.wemblog.com/custom-predicate-for-pathfield
For more on predicates, the following links can be referred :
http://www.wemblog.com/2013/04/how-to-create-custom-query-predicate-in.html
I hope this would help you.
Thanks and Regards
Kautuk Sahni
Views
Replies
Total Likes
Views
Likes
Replies
Views
Likes
Replies
Views
Likes
Replies