Skip Navigation

[Resolved] Create relationship between fields in a view

This support ticket is created 4 years, 6 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

This topic contains 4 replies, has 2 voices.

Last updated by Christian Cox 4 years, 6 months ago.

Assisted by: Christian Cox.

Author
Posts
#1362591

Tell us what you are trying to do?
I have two custom fields
1) materials
2) colors
the material Metal has colors like White and Black
the material Wood has colors like Red and Blue
I create a custom post type named jewels
When I add jewel A, I set material as Metal and color as White
I add jewel B and set material as Metal and color as Black
I add jewel C and set material as Wood and color as Blue

In the view form, I would like to have the search fields Colors that should depends on Material, So if I filter for Wood I aspect to see only Red and Black (if they are available or not is not important), today in the color select I see all the colors that are non dependent on Material choice

Thanks,
Gianni

#1362847

Hi, have you tried the setting "Only show available options for each input"? It is described in more detail at this link:
https://toolset.com/documentation/user-guides/front-page-filters/advanced-settings-custom-search/

Basically when you turn on this feature, the options for each custom search filter are dependent upon the other options you have already selected.

#1368861

Hi Christian,

thanks for you reply.
Let me try to explain another case: I have 2 fields: one is type and the other colors.
Type is: A,B,C and color is C1, C2, C3, C4
May I assign to type A color C1 and C2, and assign to type B C1, C3, C4, and assign to type C colors C4
In this way,. in the view if I select type A I will see only C1 and C2 (in the select colors) if them are available ?
Thanks

#1368989
screen1.jpg
screen2.jpg

Hi,

just a clear example, hope it will be..
If I choose a "finitura" (see screen1) Matrix the view shown correctly the 2 models with "finitura" = Matrix, if I open the select "seleziona il colore" instead of showing only the colors (seleziona il colore) available for the "finitura" Matrix, that should be bianco luna and pino Oregon, it is showing all colors with are available for the models Brio and Springs.
Does it make sense for you ?
Thanks,
Gianni

#1369405

May I assign to type A color C1 and C2...In this way,. in the view if I select type A I will see only C1 and C2 (in the select colors) if them are available ?
Not exactly, no. Custom field options for Type and Color are not "assigned" to other field options. Instead, the assignment is automatic based on the Model posts on your site.

In other words, let's say there is a Model post where Type A and Color C1 are both selected. There is another Model post where Type A and Color C2 are both selected. There are no Model posts where Type A and Color C3 are both selected. There are no Model posts where Type A and Color C4 are both selected. If your site content is created this way, when you select Type A in the filters, only Colors C1 and C2 will be available in the Color filter. The filter options depend on the content of your site, not any connection between fields in wp-admin. I hope this helps clarify the "Only show available options for each input" feature.

This ticket is now closed. If you're a WPML client and need related help, please open a new support ticket.