Tell us what you are trying to do?
I'm trying to use the repeater builder in GreenShift to display posts related to my CPT, like on hidden link. The section "Insights & Resources" at the bottom is currently built with a Toolset view, but I'd rather build that with GreenShift so I can globally control the layout with their class system.
Is there any documentation that you are following?
https://toolset.com/documentation/customizing-sites-using-php/post-relationships-api/
According to GreenShift support, their repeater builder should be able to display related posts from Toolset, but for that, I need to know how those relations are stored. GreenShift support asks me:
"you just need to know how it's stored. I believe that it's stored as post ids in custom field, then you can use Repeater builder to retrieve them. Ask support of Toolset plugin or give me proper link on documentation where it's described how it's stored in database"
And
"this documentation shows me function names but I can't see if plugin stores somewhere ids or post objects inside post meta. Can you ask author if related items are saved somewhere in connected post?"
Hi,
Thank you for contacting us and I'd be happy to assist.
Toolset stores posts relationship data in multiple custom database tables, as explained in this forum reply:
https://toolset.com/forums/topic/how-to-retrieve-post-relationship-after-converting-cpt-to-woocommerce-product/#post-2204429
This information is for the general understanding of how it works in the background. It is always recommended to use Toolset's relationship API functions ( ref: https://toolset.com/documentation/customizing-sites-using-php/post-relationships-api/ ) to interact with that post-relationship data, instead of making direct database changes.
regards,
Waqar
Hi Waqar,
I got the following response from Greenshift support:
"Again, this answered on question where it's stored in custom database, but it doesn't answer on question if it's stored somewhere in Post as custom field. Because without this, you can't get data from post and you will need to use only Toolset instruments to retrieve it"
Thanks for writing back.
> "Again, this answered on question where it's stored in custom database, but it doesn't answer on question if it's stored somewhere in Post as custom field. Because without this, you can't get data from post and you will need to use only Toolset instruments to retrieve it"
- Because Toolset stores the relationship data in custom tables, it is not stored in the form of custom fields, in the 'postmeta' table.
If you know the post ID of the target post, you can use the Toolset's Relationship API functions to get its related posts.