Using a Visibility condition with the Multiple categories selector

James Mosquito asked on November 4, 2020 12:52

Hi, I have a page type that can be added to a couple of nodes. I would like to show a Multiple category selector on pages that belong to just one of those nodes.

I tried a few options:

  1. Using 'Current page is in section' from the rule builder with the parent node selected.
  2. Manually entering the condition: CurrentDocument.NodeAliasPath.StartsWith("/MyParentNodesAlias")
  3. Manually entering the condition: CurrentDocument.NodeParentID==MyParentID

Unfortunately the control remains hidden on all nodes. Am I doing something wrong or is this a bug?

Edit: I have tested the same rules with other fields on the same Page Type with the same result so it is not exclusive to using the Multiple category selector

Correct Answer

Juraj Ondrus answered on November 4, 2020 13:13

You need to keep in mind that on the Form tab the current page/document context is not available. There are some values in the frame's URL in the query string which are identifying the object to be edited. So, you need to work with EditedObject as described e.g. in this post or this post.

0 votesVote for this answer Unmark Correct answer

Recent Answers

James Mosquito answered on November 4, 2020 14:30

Thanks Juraj using EditedObject.NodeAliasPath.StartsWith("/MyParentNodesAlias") is working.

0 votesVote for this answer Mark as a Correct answer

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