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
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.
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"
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
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/
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
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
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
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.
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.
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.