Dinamic conditions on ElementField #63
-
It seems I do something wrong or I have wrong condition path. get schema() {
return {
cms_action: {
type: 'object',
label: 'CMS Action',
schema: {
request: {
type: 'select',
label: 'CMS Action',
items: {
// actions
'action1': 'Action1',
'action2': 'Action2',
},
},
// Action1
action1: {
type: 'object',
label: 'Action1 Data',
schema: {
name: this._sourceElement('Name source'),
type: this._sourceElement('Type source'),
email: this._sourceElement('Email source'),
},
conditions: {
request: {
value: 'action1',
}
}
}
}
}
}
} |
Beta Was this translation helpful? Give feedback.
Answered by
adamberecz
Jun 3, 2024
Replies: 1 comment 2 replies
-
Reading this might give you a better idea how conditions can be defined. In this case: get schema() {
return {
cms_action: {
type: 'object',
label: 'CMS Action',
schema: {
request: {
type: 'select',
label: 'CMS Action',
items: {
// actions
'action1': 'Action1',
'action2': 'Action2',
},
},
// Action1
action1: {
type: 'object',
label: 'Action1 Data',
schema: {
name: this._sourceElement('Name source'),
type: this._sourceElement('Type source'),
email: this._sourceElement('Email source'),
},
conditions: [
['cms_action.request', 'action1']
]
}
}
}
}
} |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
If you are using it for as a configuration field the condition path should include the section as well.
So this should do the trick: