Class Name Validation

Novice User asked on September 25, 2018 00:35

How to restrict user to select only a specific page type from a path selector.I am trying general validation and try to look for the selected path and comparing it to my page type . But i don't have any idea how do I achieve this .

Correct Answer

Kàren Vaganyan answered on October 2, 2018 00:26

I’m assuming you’re using Kentico 10. You could try creating a general validation condition and use a macro similar to this:

{% Documents.Where("NodeAliasPath = '" + Path.Value + "'").WithAllData.ClassName = "YourPageType" |(identity)GlobalAdministrator%}

"Path" would be the field name of you field that uses the path selector control

0 votesVote for this answer Unmark Correct answer

   Please, sign in to be able to submit a new answer.