I have a scenario where I'd like Post B to be a child to Post A (in a one-to-one relationship). However, where my users are concerned, there are a couple of scenarios:-
1. they may not want Post A (ever)
2. they may want Post B first and want Post A later on
So my question is: can Post B be created without selecting a parent and how?
If this is possible, how can I create the association (without manually doing this in wp-admin) if they create Post A after Post B?
Many thanks
Hello,
Q) can Post B be created without selecting a parent and how?
Yes, it is possible, you can create the post B in wordpress admin side, or using Toolset form in front-end
Then you can setup a relationship form, and connect the post A with post B in front-end, see our document:
How to Build Front-End Forms for Connecting Posts
https://toolset.com/documentation/post-relationships/how-to-build-front-end-forms-for-connecting-posts/
Hi Luo
A little puzzled: if a user creates Post B first, there won't be a parent available to associate it with so what do I do with or to the parent selector in the form that creates Post B?
I've looked at the link you provided but it talks about connecting posts in a many-to-many relationship (my scenario is a one-to-one)??
In the new post type relationship of Toolset plugins, there isn't parent/child post type relationship (concept) any more, it is replaced with one-to-many relationship, you can consider it as a special many-to-many relationship, and one-to-one is a special one-to-many relationship.
The relationship form is for connectting the existed posts with other existed posts.
In your case you can try one of below options:
1) setup a relationship form to connect post A and post B
https://toolset.com/documentation/post-relationships/how-to-build-front-end-forms-for-connecting-posts/
2) Setup a post editing form to edit the post B, use it to connect post A
I disagree with your comment about there not being a parent/child 'concept' anymore; it's exactly what a one-to-many relationship is, toolset still uses 'child' and 'parent' in selectors and if using the words 'parent' and 'child' is the clearest way of explaining which side of a one-to-many relationship I'm referring to then I will continue to use them.
You still haven't explained how Post B can be created without selecting a parent but the documentation you've linked to is so complicated and the solution is IMHO cumbersome and not worth it for my requirement so I've found another way to achieve what I wanted.