Where you will replace _wpcf_belongs_projekte_id with _wpcf_belongs_{yourcptslug}_id
This support ticket is created Il y a 6 années et 9 mois. 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.
Aucun de nos assistants n'est disponible aujourd'hui sur le forum Jeu d'outils. Veuillez créer un ticket, et nous nous le traiterons dès notre prochaine connexion. Merci de votre compréhension.
I am trying to:
show repeating fields in view from parent cpt if exist.
i have a parent "projekt" with repeating child fieldset/cpt "pdownloads". In Child "objekt" of parent "projekt" i want to show the "pdownloads" of the same parent "projekt".
How can i do this? My way: i created a view (screenshot)
Actually what you can do to check if the child has a parent is to use our conditional shortcode.
[wpv-conditional if="( '[wpv-post-field name='_wpcf_belongs_job_id']' ne '' )"]
repeatable fields
[/wpv-conditional]
[wpv-conditional if="( '[wpv-post-field name='_wpcf_belongs_job_id']' eq '' )"]
some other content
[/wpv-conditional]
From the example above you see that i have the slug _wpcf_belongs_job_id , this references the custom field that the parent information is stored. Now in your case you will use "_wpcf_belongs_{parent-cpt_slug}_id" where you will replace the {parent-cpt_slug} with the slug of your CPT.
Ahh yes I didn't what I did was to add a filter to the view for the parent projekt , since the objekte and the pdownloads share the same parent cpt, so essentially pdownloads and objekte are siblings. So if I found the parent of the current objekte that i'm viewing then I can use that parent information to find the pdownload.
I did that by adding this filter. See Screenshot
Then I filtered the view using the shortcode parameter.