When entering content, I have a drop down box that let’s users pick between two items, itemA and itemB.
If the user picks itemA, then I want a related field to appear with an EditLive control. If the user picks itemB, then I want a different related field to appear, with just an EditBox.
Basically, I want some branching logic going on here on the fly in the content editor.
I thought this would be controlled via the Visibility option, putting some sort of conditional statement in there that would read the drop down value and make the related field either appear or disappear.
However, when I scroll through the Content Item Data type, the dropdown field does not appear as an option. Getting in to the documentation, I started thinking that the visibility control is more of an onLoad type thing, versus something that is always checked against.
Any ideas on how to do this, or if it is possible at all?
itemA and itemB are selections in a drop down. Which field would show after the drop down would depend on which item was selected.
Using Content Item Data in Visibility Rules is not supported out of the box.
You can write an extension to make this functionality available. Use the Content Manager to retrieve the item node so you can access the field data.
Note that changes to visibility will only be reflected when you save the Content Item (not immediately on changing the value in the field). Visibility rules doe not update the Content Editor on the fly.
And that’s what I needed. I have a work around that will accomplish what I needed while showing all the fields, it just would have been nice (and stopped potential user confusion) to be able to hide and show fields on demand.