Skip Navigation

[Resolved] Would lIke to display the Parent Title in the Child WordPress Admin table

This support ticket is created 5 years, 6 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
- - 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00
- - - - - - -

Supporter timezone: Asia/Ho_Chi_Minh (GMT+07:00)

This topic contains 3 replies, has 2 voices.

Last updated by Beda 5 years, 6 months ago.

Assisted by: Beda.

Author
Posts
#1296557

Tell us what you are trying to do?
I'd like to display the Parent title in the table of one of it's Child posts.

Is there any documentation that you are following?
I can't find specific documentation on how to do this

Is there a similar example that we can see?
No, but I simply would like to add a column to the table that includes the Parent Title.

What is the link to your site? hidden link

#1296681

That's not possible natively in either Toolset or WordPress.
You'd need Custom Code to do that.

You can follow this tutorial for example, which shows how to add items to the table of Posts Admin Screens.
hidden link

Instead of Custom Fields, you'd, however, be using the Toolset Relationships API to populate the column.
You'd use the Post ID as the above tutorial also uses and according to that, get the Related Posts. Note, I am not sure how you plan to organize "many" posts in such a column, let's assume you have a many to many with many parents, you will have a lot of data compressed there in a narrow column.

If it's just to display one parent in a One To Many relationship, you could eventually squeeze in the title or ID.
The API to get related Posts to use in this case is:
https://toolset.com/documentation/customizing-sites-using-php/post-relationships-api/#toolset_get_related_post

However this is not something our Support here can create for you, we could assist during the process if you have questions related to the Toolset Relationships API code.
Please let me know if so

I'd also suggest, that you add this request here https://toolset.com/home/contact-us/suggest-a-new-feature-for-toolset/, so the Product Management is aware of the need and can eventually plan implementations alike that.

#1296891

Sorry, but this is very disjointed and none of these pages you've linked to are clear about how to get the title of a parent of a child post. The way that relationships between posts are created is actually very disappointing in Toolset. If I must know custom code to make the relationships useful, that's not good. Maybe relationships should follow are more relational database approach where two fields join the tables and they are available to each custom post type. This lack of functionality seems to be a major product design flaw. I did add it to feature requests, but your product team really should have thought through how relationships between posts need to be used by end users.

I did find a $99 plug-in that seems to add this functionality, but it does seem a bit crazy to pay that much for something that should be so simple, but since there is no clear documentation, I will have to do that.

#1298321

1. Sorry, but this is very disjointed and none of these pages you've linked to are clear about how to get the title of a parent of a child post.

To get the title of a parent of a Child Post when those are related using Toolset Types you will use the Toolset API (if you need to use PHP; like in this case):
https://toolset.com/documentation/customizing-sites-using-php/post-relationships-api/#toolset_get_related_post
There are code examples in that Document, that shows how to get the data of a parent post.
This can be adapted to your case, and used in the code that calls the data to display in the column.

2. The way that relationships between posts are created is actually very disappointing in Toolset. If I must know custom code to make the relationships useful, that's not good.

I apologise that you do not like the relationships implemented. I suggest to sending suggestions for more features here https://toolset.com/home/contact-us/suggest-a-new-feature-for-toolset/, and if you see usability issues, please let them know us here in the ticket, so I can escalate them

You do not need to know any custom code to use those relationships - you can do that easily in a View, or single posts, using ShortCodes, as our DOC explains (and the GUI as well). More on that here:
https://toolset.com/documentation/post-relationships/how-to-display-related-posts-with-toolset/

However, you need custom code to display those in the posts column which is something simply not supported by Toolset Types.

3. Maybe relationships should follow are more relational database approach where two fields join the tables and they are available to each custom post type

This is what was before, and not powerful enough for the Toolset users, who asked for real Post Relationships and not custom field references, which is still possible to do (with the Posts Reference Field) but it's not a "real" post-relationship. Now, Types stores the relations in Custom Tables which relate to the posts and hence bring performance and usability improvements.

You can however always suggest such changes to https://toolset.com/home/contact-us/suggest-a-new-feature-for-toolset/
We cannot handle such feature requests in the forum directly, unfortunately

4. This lack of functionality seems to be a major product design flaw. I did add it to feature requests, but your product team really should have thought through how relationships between posts need to be used by end users.

Well, I am not sure I follow here.
Mostly those are displayed in the front end, and as I said, displaying them in the backend posts list is only half a "feature", as it would not apply to many to many relations (it simply would/could become too large data to be added to the column).
Relationships can be currently fully set in the backend, front end, and displayed in both single edit backend and front end lists or single posts or else content.
I think this is very powerful but of course can always be improved (mainly in Forms where it is not supported as extensively as the backend, for example).
Our Product Manager will consider the suggestions sent in, and eventually things will be implemented in Toolset if decided so and considered useful by several users and Product Management.

Please let me know if I can further help on the taskk!