Tell us what you are trying to do?
I build a restaurant menu using repeater field and cpt.
Each menu section is a different post with and ID and slug.
I try to output if my field (nombre-de-morceaux) is empty and came from the post ID 205/slug sushi-sashimi that is a parent of this repeater field.
Hi Shane,
I want to display a text if a certain field (nombre-de-morceaux) is empty AND the parent Id is 205.
The case :
I have a CPT called Sushi menu.
Each meal section is a post of sushi menu.
In every meal/post, there is the sushi items coming as a repeater field.
So in this view
if the field "nombre-de-morceaux" from the repeater field "items-au-menu-sushi" is empty
AND
the repeater field is display from post id 205
THEN
display my text
Assuming that you are already displaying the items from the repeater fields. The parent you want to check the ID for is the post that the repeatable field is attached to correct?
If so then Its not possible to get the ID of the post that the repeatable fields are attached to.
Good morning Shane,
oh, that's bad. Can I check by some other way the post that contain the repeater field?
Any workeround ? If not id, I suppose the slug will not do neither...
I know in our latest views Beta you are able get the ID of the parent post type. However since this is a Beta i'm not certain if the code will work in a conditional field.
If you had done this as a post relationship then we would've been able to get the parent ID in the current version of views without any issues at all.