<p>So I'm going to add this as an answer just in case others find it a useful option to pursue. </p>

<p>I would create your fields; <code>voltage</code>, <code>flow rate</code>, etc. then I would create a Structure called <code>Products</code> with different Entry Types corresponding to the various categories you are using to sort your products. Then you can add your fields to the appropriate Entry Types. Then when you go to add a new product, you'll have a dropdown where you can select what Entry Type this entry should be. </p>

<p>That's how I would setup your site structure if I were in your place </p>

CC BY-SA 3.0
2017-09-04T12:36:28.927Z
2017-09-04T12:36:28.927Z
Jalen Davenport
<p>I have entries called <code>products</code>. Those entries are organized in categories. I'm using fields to save technical data for each product ( ex. Flow rate, Pressure, Voltage, etc. ).
Not all fields suit all product categories ( ex. Voltage doesn't make sense for pneumatic pumps ). 
Is there a way to associate some fields only to products in a specific category?</p>

<p>Thanks</p>

CC BY-SA 3.0
2017-08-28T14:27:32.283Z
It seems like this would be a good use case for Structures and Entry Types?
Jalen Davenport
CC BY-SA 3.0
2017-08-28T15:39:09.767Z
I thought about that but it doesn't seem the right solution to me. Products are not different entry types, they just have different features.
Also, it can become tricky to add other layers of categorization to different entry types.
Alessio Breviglieri
CC BY-SA 3.0
2017-09-01T09:03:49.677Z
@AlessioBreviglieri There is no way to natively do that in Craft (right now). The simplest way on the front end through templates is to check for each field and show only the ones that have a value defined. Otherwise I see a way in matrix fields.
Dominik Krulak
<entries><categories><field>
Dynamic fields layout based on categories
# Dynamic fields layout based on categories

(Asked by: username_0 on 2017-08-28)

I have entries called `products`. Those entries are organized in categories. I'm using fields to save technical data for each product ( ex. Flow rate, Pressure, Voltage, etc. ).
Not all fields suit all product categories ( ex. Voltage doesn't make sense for pneumatic pumps ).
Is there a way to associate some fields only to products in a specific category?

Thanks

**Tags:** entries, categories, field

> **Comments:**
> **username_1**: It seems like this would be a good use case for Structures and Entry Types?  
> **username_0**: I thought about that but it doesn't seem the right solution to me. Products are not different entry types, they just have different features. Also, it can become tricky to add other layers of categorization to different entry types.  
> **username_2**: @AlessioBreviglieri There is no way to natively do that in Craft (right now). The simplest way on the front end through templates is to check for each field and show only the ones that have a value defined. Otherwise I see a way in matrix fields.  

---

## 1 answers

### Answer by username_1 on 2017-09-04. Score: 1

So I'm going to add this as an answer just in case others find it a useful option to pursue.

I would create your fields; `voltage`, `flow rate`, etc. then I would create a Structure called `Products` with different Entry Types corresponding to the various categories you are using to sort your products. Then you can add your fields to the appropriate Entry Types. Then when you go to add a new product, you'll have a dropdown where you can select what Entry Type this entry should be.

That's how I would setup your site structure if I were in your place


---

