[details=“System Information”]
- Strapi Version:5.33.2
- OS: Ubuntu
- Database: Postgres 16
- Node Version: 22
- Yarn Version: v1.22.22
I’m working with Strapi (v5) and have created a component for banners. The component has an enumeration field calledcomponent_type, which controls which media fields should be visible in the Admin UI.
Use case
Based on the selected component_type, I want to conditionally show media fields:
media-left→ show left image fieldsmedia-right→ show right image fieldsmedia-center→ show center image fieldsmedia-both→ show BOTH left and right image fields
Current component schema
"component_type": {
"type": "enumeration",
"enum": ["media-left", "media-right", "media-both", "media-center"]
}
Example media fields:
"left_image_desktop": {
"type": "media",
"conditions": {
"visible": {
"==": [
{ "var": "component_type" },
"media-left",
"media-both"
]
}
},
"multiple": false,
"allowedTypes": ["images"]
}
"right_image_desktop": {
"type": "media",
"conditions": {
"visible": {
"==": [
{ "var": "component_type" },
"media-right",
"media-both"
]
}
},
"multiple": false,
"allowedTypes": ["images"]
}
Problem
When component_type is set to media-both, I want both left and right image fields to be visible in the Admin UI.
However:
- Only one field becomes visible
- OR the condition does not behave as expected
I also tried using logical operators like ||, but the behavior is still inconsistent.
What I’m looking for
- Correct way to define conditional visibility for multiple values in an enumeration
- Whether Strapi supports OR conditions (
media-leftORmedia-both) properly in component schemas - Or if this is a known limitation in the Admin UI
Questions
- Is it possible to show multiple media fields for a single enum value (
media-both)? - What is the recommended way to write conditions for this use case?
- Is this supported in Strapi v5 Admin UI, or is a custom admin plugin required?