Really hope someone can help me with this.
Heres the easiest way that I can explain what I am looking for…
IF Sub Field of Repeater(A) on POST 1, matches Sub Field of Repeater(B) on POST 2, GET all Sub Fields from Repeater(B).
Here is the structure I have…
POST 1 – This is to act as a main list of all tools
- Repeater Field (toolslist)
- Text Sub Field 1 (tool_name)
- Image Sub Field 2 (tool_image)
- Textarea Sub Field 3 (tool_description)
POST 2 – This is one post of many, that would list tools specific only to this post, but pull the data from the main list in POST 1.
- Repeater Field (tools_materials)
- Selection Sub Field 1 (tool_material) <– Contains a list of all tools that are in the main list (toolslist).
- Text Sub Field 2 (tool_material_detail)
So for example, once POST 1 (tools_list) is set up with a list of tools, I want to then be able to create POST 2, and simply select a tool using the selection sub field 1 (this list would be manually populated to match the names from tool_name in the main list). Then some how do a check in the while statement to see if tool_material from POST 2 matches up with tool_name from POST 1, and if so, pull all the data from that tool in POST 1 and display it on POST 2.
I have tried numerous different methods with while statements and so on but I simply can’t get this to work from repeater to repeater. I managed to get it working if POST 2 only has a checkbox field (not a repeater), but I want to also incorporate the tool_material_detail to be able to append extra information on POST 2 if needed.
So again, I want something like this (in baby language)…
IF tool_material == tool_name,
THEN GET tool_name, GET tool_material_detail (from matching tool_material), GET tool_image, GET tool_description.
Apologies if this is communicated really badly but I find it complicated just thinking about it let alone explaining it. Would appreciate any help.
Thanks in advance.
ACF PRO v5.2.1
WP v4.0.1