Skip Navigation

[Resolved] display parent post with detailed listing of all its children

This support ticket is created 6 years, 3 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 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Hong_Kong (GMT+08:00)

This topic contains 12 replies, has 2 voices.

Last updated by Luo Yang 6 years, 3 months ago.

Assisted by: Luo Yang.

Author
Posts
#1098556
plant-parent.png
Complaint - Single Child Post.png
loop item in listing child posts.png
view -listing child posts.png

I'm using this documentation:
https://toolset.com/documentation/post-relationships/how-to-display-related-posts-with-toolset/displaying-related-child-posts/
to create a parent with children view - see the screenshots.
I'm not clear what shortcode to enter or where to enter it to see the details of plant parent with a listing of details of all its children - complaints treated by this plant.
Thanks for any help
David

#1099290

Dear David,

I assume we are talking about this:
In as single parent post, setup a view to display all the related child posts.

If it is, you just need to setup one post view, list related child posts, and display this view in the content of parent post, see our document:
https://toolset.com/documentation/post-relationships/how-to-display-related-posts-with-toolset/#displaying-many-related-items
section "Displaying many related items",

If you still need assistance for it, please provide a test site with the same problem, also point out where do you want to display:
details of plant parent with a listing of details of all its children

I can setup a demo for you.

#1100298

I assume we are talking about the view "Complaints list", I have done below modifications in your wesbite:

1) Edit the view "Complaints list", we need to query the related "Complaints" posts
hidden link
we need to query the related "Complaints" posts:

In section "Content Selection", choose only one option: Complaints

in section "Query Filter", change the filter to relationship filter:
Select posts in a Plants Complaints relationship that are related to the Post where this View is shown.

2) Edit the "Plant" post "Alhagi graecorum Boiss.", we need to setup some related "Complaints" posts to test the result
hidden link

In section "Plants Complaints", relate with a test post "test 1".

See the result here:
hidden link

You should be able to see the post title "test 1"

#1100324

Hi Luo, Thanks, I do see Test1, however the example page I sent you - Alhagi graecorum boiss - has about 16 complaints as children of this plant - eg. hidden link.
How do I see them on this page.

Thanks
David

#1100347

Dear David,

Please edit the plant post "Diuretic (id. 233)":
hidden link

In section "Plant Complaint", you need to setup relationships to other 16 "complaints" posts

More help:
https://toolset.com/documentation/post-relationships/how-to-set-up-post-relationships-using-toolset/

#1100358

Hi Luo, Yes that works, but I can't do this for over 500 complaints. Is there no way to automate this? I've setup the relationship, I've setup Plant posts as parents and Complaints as the children of Plants - with the correct wpv-post-id. If I delete the complaints and reload the complaints csv file will the complaints be added to their respective plants?

Thanks
David

#1100424

Yes, it is possible with other CSV plugin, for example:
https://toolset.com/documentation/user-guides/how-to-import-content-into-wordpress-using-csv/import-csv-ultimate-csv-importer-plugin/how-to-import-posts-from-csv-files-and-maintain-relationships-when-using-the-csv-importer-plugin/

Please feel free to create new thread if there is other problem to import the post relationships.

#1100444

Hi Luo, thanks, looking at Example 2: one-to-many relationships I'm not clear if I need to reload both Plants and Compaints csv files or if it's enough to just reload the children posts - Complaints.

Thanks
David

#1100454
#1100735
parent-csv.JPG
child-csv.png

What happened to using _wpcf_belongs_plant_id in the child post to connect the child to its parent.
This is how I understood a parent child link was made

#1101287

The field "_wpcf_belongs_[PARENT-SLUG]_id" field is for the old version of Types plugin, in the latest version of Types plugin, with the new post type relationship, please follow the document as I mentioned above to import the post relationship:
https://toolset.com/documentation/user-guides/how-to-import-content-into-wordpress-using-csv/import-csv-ultimate-csv-importer-plugin/how-to-import-posts-from-csv-files-and-maintain-relationships-when-using-the-csv-importer-plugin/

If there is other new questions, please create new threads, that will help other users to find the answers.

#1101623

It's far more complicated for me to insert a list of child post titles into each parent as the example shows, then it was to add 1 parent post id into each child, I guess it's still possible to use the old method. As I understand with the new method I just need to reload the parent posts.

#1102269

You can "Reload" the child posts only, for example, follow our document to import the child posts:
https://toolset.com/documentation/user-guides/how-to-import-content-into-wordpress-using-csv/import-csv-ultimate-csv-importer-plugin/how-to-import-posts-from-csv-files-and-maintain-relationships-when-using-the-csv-importer-plugin/

In the screenshot
hidden link

Setup the value of column "related_posts" as the parent post title, in your case it is a one-to-many relationship, so there is only one parent post title.