Hai,
As of now, I am using the plugin like -
- A Parent content and Child listed below
- All Child Pages Content + Sibling content listed below and interlinked. (Called using parent)
My Question for Future Release in Types One to many or many to many relationship ?
- If I have same Child with 3 parents then,
- All Parent pages content + child content below - perfect no issues.
- How Can I call sibling for each child. My site is very huge one I cant manually assign each time. I just created a content template and working fine. I really want this one to many relationship.
** Can I set a primary Parent / Super parent / 1st Parent like that so my templates will work fine by default it will use super parents to list sibling in my automated template system.
My site have more than 1000+ child and 100 parents and it will grow even 50k childs and 5k parents. This one/many to many will be really useful until I assign super parent or some solution to resolve the calling of sibling in templates/views.
Thank you,
Jay
I am not entirely sure to follow.
In Views you can either display brother pages or related child posts.
Brother pages are using ONLY the WordPress inbuilt feature of Parent Pages, and the Types Plugin does not change anything in that, also not when the new many to many is out.
This approach is and stays the same as it's simply not based on Toolset but WordPress native features that you can also use on Custom Post Types:
https://toolset.com/documentation/user-guides/displaying-brother-pages/
Related Child Posts are posts that have the same parent post set by Types plugin. This is not using WordPress native features but our features, and this will change when the new updates will come.
Here the display of things also should not change. You are always on one single post, and hence, you can never display brother pages that are not related to this post.
If you want to display posts that belong to Post Type A and it's related Childs, then you can simply also follow the below DOC:
https://toolset.com/documentation/user-guides/displaying-related-child-posts/
If you want to do the same for other post types, you need to do that for each relation.
Thanks for your reply.
I have done what you have mentioned above. I am showing related child post in every child post i have. Everything is working fine. I am using template for my custom post type which is a child. All related child are called using parent post.
My question is related to beta type upcoming one,
if i have One to Many relationship, How can I call related child since we are having more than one parent which one it will consider ?
Yes, of course, I understood that.
And as elaborated, when the new versions will be released, the workflow should be like here:
https://toolset.com/forums/topic/can-we-set-primary-parent-in-onemany-to-many-post-relationship-upcoming-one/#post-587037
We add the possibility to add several parents of the same type, yes, but in WordPress when you view a single post you can query only that one single post and use it as the parent of your child posts.
You cannot get another parent on the fly.
You are in the current post and that is what Toolset will use.
To add Childs Posts that are child to the current, but also to other posts, you would need to pass in 2 IDs (post objects).
This is usually needless as you will never be on 2 parent post simultaneously
You can display the Child Posts of a Post, and of course if you want, also child to other posts thru a View, but you will not have 2 Post objects to depend on.
You will always be viewing one parent single post and a list of it's child posts, right?
Right now since we have one to one, I created a Content template for my custom post type which is a child so by default it will list all related child according the parent which is only one. There is no need to pass parent id.
If I use upcoming plugin, one to many and I still want to automate listing of related child without passing parent id is the challenge I face now.
Can i have option like set primary Parent - in case of content template to list related child without passing parent id - the default one will be used.
I cant disclose my URL here. if you see my website you will understand. The upcoming release is a boon for me with this limitation.
You do need to pass an ID.
This is done in the View, in the Query Filter, where you decide to show posts only that have as parent the page where this view is inserted.
There is no other way to display a child post.
There you can also manually add an value.
But I understand what you mean. You would need to know the ID of those other parents, or at least use a ShortCode that dynamically gets them, and that should be easier.
I will consult with the developers, please allow me a few minutes.
No, this does not make sense to us.
Pleas share the links where I see what you mean, I apologize that we do not understand your need.
You can create as many Views to display Child posts of any type accepting any parent argument you want.
You can use them in your content template and nothing needs to be edited at all.
But eventually I do misunderstand.
I activated a private reply so you can elaborate this safely.
Thank you
I do, but you can already do that without any line of code or hard setting of ID's, and as well when we will release the new Types versions.
This is just a View, in a Content Template, that displays posts that are child to the post where this View is inserted.
And that works for all posts types, no matter how nested they are.
A current post is always one, single post and will pass that ID to the View so the View displays only Childs of this very parent.
If you have 3 layers (super parent, parent, child) it's the same, you just create one more View.
So you end up with a View that queries there Child posts of the currently displayed post.
In this View Loop you have a View that queries the Child Posts of the Parent post buried in Parent View.
That parent View is inserted to the Content Template of your super parent.
Please can you add admin details in case this needs an example?
I think you misunderstand this.
A "one to many" relationship in Toolset is a relationship from many Child posts to One Parent Post only.
A parent can have several child posts of the same type.
A Child cannot have several parents of the same type.
Right, it's easy to display a "one to many" relationship:
- You create a parent post and attach several Child posts
- You create a view, and in that View you query Child posts
- You add a Query filter that filters the posts who's parent is the post where this View is inserted
- You insert this View in a Parent Post (or in the content template applied to parent posts
==> This now displays ALL Child Posts of the current parent.
You can NEVER view more than one post in WordPress using your single post template.
So, if your child posts will have many parents of the same type (many to many) you still will be displaying child posts only on ONE parent Post a time, since you cannot view more than one post a time.
You can use the same View as above created for this. Nothing changes at all.