<p>No, Craft doesn't offer conditionals in field layouts. Coming from Wordpress/ACF, I'd personally like to see something like that implemented in the future, but for now I can think of two possible workarounds for your specific scenario:</p>

<ol>
<li><p>Set up two different <a href="http://buildwithcraft.com/docs/sections-and-entries#entry-types" rel="noreferrer">Entry Types</a> for your "products" section, e.g. "Video" and "Image". Design identical field layouts for the two, apart from including the field "productVideo" for the former, and "productImage" for the latter.</p></li>
<li><p>Use only one entry type, but replace the "productVideo" and "productImage" fields with a <a href="http://buildwithcraft.com/docs/matrix-fields" rel="noreferrer">Matrix field</a> called "productMedia" or the like. Set up two block types for the Matrix field; one for "productVideo", and one for "productImage". Limit the Matrix field to maximum one block.</p></li>
</ol>

CC BY-SA 3.0
2015-03-08T23:38:33.937Z
Sounds like a great [feature request](http://feedback.buildwithcraft.com/)!
Brad Bell
CC BY-SA 3.0
2015-03-09T00:14:57.327Z
Don't mind if I do, @BradBell! Just posted a (fairly lenghty) [request](http://feedback.buildwithcraft.com/forums/285221-feature-requests/suggestions/7185745-conditionals-in-field-layouts).
Mats Mikkel Rummelhoff
CC BY-SA 3.0
2015-03-09T00:16:00.163Z
Thanks... we've only soft launched that site so you're the first!
Brad Bell
CC BY-SA 3.0
2015-03-09T00:16:41.053Z
Oh, I didn't realize – very cool!
Mats Mikkel Rummelhoff
CC BY-SA 3.0
2015-03-09T00:24:56.113Z
Yes. The List is back!
carlcs
CC BY-SA 3.0
2015-03-12T17:39:15.740Z
Thanks for the feedback, and for the feature request. Voted on it - seems like its  one of the top requests!
Daniel Paras
CC BY-SA 4.0
2018-08-15T21:02:41.507Z
Awesome idea with the entry types. I hadn't thought of that :D I also came from Wordpress/ACF so I was unaware of entry types completely! Seems awesome.
Radmation
CC BY-SA 3.0
2018-03-23T16:25:36.857Z
The link of the idea was broken, so i created a [new one (for Craft v3+)](https://craftcms.uservoice.com/forums/295386-commerce/suggestions/33731092-conditional-fields)
ricricucit
CC BY-SA 3.0
2015-03-08T23:37:50.033Z
2015-03-08T23:37:50.033Z
Mats Mikkel Rummelhoff
<p>The <a href="http://feedback.buildwithcraft.com/forums/285221-feature-requests/suggestions/7185745-conditionals-in-field-layouts" rel="nofollow noreferrer">feature request for this</a> has been very popular since day one, so hopefully it's something P&amp;T adds to the core some day.</p>

<p>For the interim I just published a small plugin called Reasons, which will add simple field/value based conditionals to entry type field layouts - pretty much exactly like the OP describes it.</p>

<p>Download from GitHub: <a href="https://github.com/mmikkel/Reasons-Craft" rel="nofollow noreferrer">https://github.com/mmikkel/Reasons-Craft</a></p>

<p><strong>Edit</strong>
P&amp;T retired the UserVoice page; <a href="https://github.com/craftcms/cms/issues/805" rel="nofollow noreferrer">here</a> is the new home for the feature request</p>

CC BY-SA 3.0
2018-03-23T16:26:02.360Z
Since Reason has been abadoned, [please vote this idea here](https://craftcms.uservoice.com/forums/295386-commerce/suggestions/33731092-conditional-fields)
ricricucit
CC BY-SA 3.0
2018-03-24T16:42:02.970Z
@ricricucit Field layout conditionals is coming as a Native feature, but no word on when (definitely not in 3.0, but hopefully in a minor 3.x release :)
Mats Mikkel Rummelhoff
CC BY-SA 3.0
2018-03-24T16:43:34.003Z
Oh - and Reasons has not been abandoned, per se; I just patched it last month. It won’t get ported to Craft 3, though (unless somebody else does it, of course)
Mats Mikkel Rummelhoff
CC BY-SA 4.0
2015-05-26T05:43:38.237Z
2018-12-04T00:44:51.880Z
2018-12-04T00:44:51.880Z
Mats Mikkel Rummelhoff
<p>is it somehow possible to conditionally show or hide fields in the entry editor based on the value of another previously entered field? </p>

<p>An example of this use would be:</p>

<ul>
<li>A section has Lightswitch field "hasVideo"</li>
<li>User is populating a new entry for this section and sets "hasVideo" to the value of choice.</li>
<li>If user sets hasVideo to true, show a text field "productVideo" so that the user can set a link to a youtube video, but hide assets field "productImage".</li>
<li>If user sets hasVideo to false, how Assets field "productImage" so that the user can upload an image, but hide "productVideo" field.</li>
</ul>

<p>This would really help from a usability perspective since the client will only be shown the fields that need to be filled based on what was filled earlier on - creating a sort of entry creation "wizard". </p>

<p>Naturally there might be an alternative route to achieve the same level of usability that I'm missing.</p>

<p>Thanks in advance! </p>

<field><admin>
"Conditional" field layout - hiding or showing fields based on another field
# "Conditional" field layout - hiding or showing fields based on another field

(Asked by: username_0 on 2015-03-08)

is it somehow possible to conditionally show or hide fields in the entry editor based on the value of another previously entered field?

An example of this use would be:

* A section has Lightswitch field "hasVideo"
* User is populating a new entry for this section and sets "hasVideo" to the value of choice.
* If user sets hasVideo to true, show a text field "productVideo" so that the user can set a link to a youtube video, but hide assets field "productImage".
* If user sets hasVideo to false, how Assets field "productImage" so that the user can upload an image, but hide "productVideo" field.

This would really help from a usability perspective since the client will only be shown the fields that need to be filled based on what was filled earlier on - creating a sort of entry creation "wizard".

Naturally there might be an alternative route to achieve the same level of usability that I'm missing.

Thanks in advance!

**Tags:** field, admin


---

## 2 answers

### Answer by username_1 on 2015-05-26. Score: 9 | Accepted answer

The [feature request for this](http://feedback.buildwithcraft.com/forums/285221-feature-requests/suggestions/7185745-conditionals-in-field-layouts) has been very popular since day one, so hopefully it's something P&T adds to the core some day.

For the interim I just published a small plugin called Reasons, which will add simple field/value based conditionals to entry type field layouts - pretty much exactly like the OP describes it.

Download from GitHub: <https://github.com/mmikkel/Reasons-Craft>

**Edit**
P&T retired the UserVoice page; [here](https://github.com/craftcms/cms/issues/805) is the new home for the feature request

> **Comments:**
> **username_5**: Since Reason has been abadoned, [please vote this idea here](https://craftcms.uservoice.com/forums/295386-commerce/suggestions/33731092-conditional-fields)  
> **username_1**: @username_5 Field layout conditionals is coming as a Native feature, but no word on when (definitely not in 3.0, but hopefully in a minor 3.x release :)  
> **username_1**: Oh - and Reasons has not been abandoned, per se; I just patched it last month. It won’t get ported to Craft 3, though (unless somebody else does it, of course)  

---

### Answer by username_1 on 2015-03-08. Score: 5

No, Craft doesn't offer conditionals in field layouts. Coming from Wordpress/ACF, I'd personally like to see something like that implemented in the future, but for now I can think of two possible workarounds for your specific scenario:

1. Set up two different [Entry Types](http://buildwithcraft.com/docs/sections-and-entries#entry-types) for your "products" section, e.g. "Video" and "Image". Design identical field layouts for the two, apart from including the field "productVideo" for the former, and "productImage" for the latter.
2. Use only one entry type, but replace the "productVideo" and "productImage" fields with a [Matrix field](http://buildwithcraft.com/docs/matrix-fields) called "productMedia" or the like. Set up two block types for the Matrix field; one for "productVideo", and one for "productImage". Limit the Matrix field to maximum one block.

> **Comments:**
> **username_2**: Sounds like a great [feature request](http://feedback.buildwithcraft.com/)!  
> **username_1**: Don't mind if I do, @BradBell! Just posted a (fairly lenghty) [request](http://feedback.buildwithcraft.com/forums/285221-feature-requests/suggestions/7185745-conditionals-in-field-layouts).  
> **username_2**: Thanks... we've only soft launched that site so you're the first!  
> **username_1**: Oh, I didn't realize – very cool!  
> **username_3**: Yes. The List is back!  
> **username_0**: Thanks for the feedback, and for the feature request. Voted on it - seems like its  one of the top requests!  
> **username_5**: The link of the idea was broken, so i created a [new one (for Craft v3+)](https://craftcms.uservoice.com/forums/295386-commerce/suggestions/33731092-conditional-fields)  
> **username_4**: Awesome idea with the entry types. I hadn't thought of that :D I also came from Wordpress/ACF so I was unaware of entry types completely! Seems awesome.  

---

