Reputation: 1256
I have a custom page type, and the editor will have the option to enter the following
The field names are as follows
So, if an editor ads a SlideImage, SlideVideo and YouTubeVideoID should not be usable. Same for SlideVideo and YouTubeVideoID.
Within the Visibility Condition fields, i'm going to assume a macro is needed for this. My logic is:
This field visible if Field A or B have data.
Upvotes: 0
Views: 745
Reputation: 838
A possible approach can be to add an additional field, which determines the field that should be used.
Create a text field (let's say, SlideType
) and use a radio button form control with your options:
image;Image
video;Video
youtube;YouTube
Tick the "Has depending fields" checkbox for this field, and tick the "Depends on another field" checkbox for the SlideImage
, SlideVideo
and YouTubeVideoID
fields.
Your visibility conditions would then be simplified, instead of checking the values of multiple fields.
For example, the visibility condition for the SlideVideo
field would be:
SlideType == "video"
This has a few benefits:
SlideType
field to determine which field to useUpvotes: 1
Reputation: 1442
Let's say the column name on which this value of your depending field is "FirstName", so you can write in the dependent field -> Visibility Condition as
FirstName.value != ""
or
FirstName.value
You can twist the conditions for as many conditions as possible and can club more than one condition too.
I am also sharing links with you having a lot of examples from Kentico support
Using dependency fields in forms
Cheers, Chetan
Upvotes: 0
Reputation: 2650
Add this to Visibility condition in Page type field edit:
Fields.SlideImage.Value == String.Empty
Do not forget to set proper Has depending fields and Depends on another field properties depending on your needs. You can learn more about these properties here.
Upvotes: 0