Skip Navigation

[Resolved] Create a view CPT parent with a button link CTP child

This thread is resolved. Here is a description of the problem and solution.

Problem:

The issue here is that the user wanted to filter his child view by passing the ID of the parent to the view using a URL parameter.

Solution:

In order to do this you will need to create a view that will list the child. On that view you then want to add a query filter for the parent.

Once the filter is added then you will need to set it to "Post with ID set by the URL parameter " and then note the parameter that it requires.

Next you need to build a page to hold this child view.

Finally you need to modify the button on your parent listing table so that when you click it, you're taken to the page this the child view.

So the link should be.

<a href='linktochildpostviewpage?wpv-pr-child-of='[wpv-post-id]'>Click Me</a>

Once you have done this it should display the listings of the parent you click on.

This support ticket is created 6 years, 7 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.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 9:00 – 12:00 -
- 13:00 – 18:00 13:00 – 18:00 13:00 – 18:00 14:00 – 18:00 13:00 – 18:00 -

Supporter timezone: America/Jamaica (GMT-05:00)

This topic contains 1 reply, has 2 voices.

Last updated by Shane 6 years, 7 months ago.

Assisted by: Shane.

Author
Posts
#626622
workoutview2018-03-20.jpg

I have a CPT parent named "member", with a CPT child called "workouts" and I need to create a view with a list of all the members where each member have a column with a button link that takes me to a view of all their own workouts. I need to create a view like this image attached. Can you give me a hint on how to do so ? thanks for your support.

site url: hidden link

#626714

Shane
Supporter

Languages: English (English )

Timezone: America/Jamaica (GMT-05:00)

Screen Shot 2018-03-20 at 1.34.00 PM.png

Hi Alberto,

Thank you for contacting our support forum.

In order to do this you will need to create a view that will list the child. On that view you then want to add a query filter for the parent See Screenshot.

Once the filter is added then you will need to set it to "Post with ID set by the URL parameter " and then note the parameter that it requires.

Next you need to build a page to hold this child view.

Finally you need to modify the button on your parent listing table so that when you click it, you're taken to the page this the child view.

So the link should be.

<a href='linktochildpostviewpage?wpv-pr-child-of='[wpv-post-id]'>Click Me</a>

Once you have done this it should display the listings of the parent you click on.

Please let me know if this helps.
Thanks,
Shane