How to get UniSelector form control to limit documents to a relative path?

Michael Eustace asked on November 27, 2017 19:50

I am using the UniSelector on a page type field to display multiple documents, except I only want child documents of the current page to be listed for the CMS Editor to select.

In the WHERE clause of the UniSelector control settings I am entering the following:

NodeAliasPath LIKE '{% CurrentDocument.NodeAliasPath #%}/%'

but the macro is not returning as the control then displays all documents in the site tree.

What is the correct syntax for this? I followed the answer here too but is doesn't work for me either.

Thanks, Michael

Correct Answer

Brenden Kehren answered on November 27, 2017 22:14

If you're needing it to work in the Editor/Form tab, then use

EditedObject.NodeAliasPath instead of CurrentDocument.NodeAliasPath.

The CurrentDocument context is only available on the live site and not within the Kentico UI.

1 votesVote for this answer Unmark Correct answer

Recent Answers


Michael Eustace answered on November 27, 2017 22:53

Thanks Brendan. Yes I am needing it to work in the Form tab. Works perfectly.

0 votesVote for this answer Mark as a Correct answer

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