Hi
I want to be able to show the name of the parent of a post in a grid. Similar to this post
https://toolset.com/forums/topic/link-to-parent-relationship-not-working-in-grid/
But with a different plugin. The plugin I want to use was working in the old version of Toolset, see solution here:
https://toolset.com/forums/topic/i-want-to-pull-metadata-into-a-grid-plugin-pulling-from-parent-relationship-wa/
It now does not work with updated toolset.
Info on the plugin can be found here:
hidden link
Thanks
In the updated Toolset post relationships system, information about related posts is no longer stored in postmeta. So the approach used before isn't possible with new post relationships. We might be able to figure out a different approach.
1. What are the slugs of the two post types?
2. What is the post relationship slug? You can find this in Toolset > Relationships.
3. Which post type is the parent and which post type is the child?
Hi Christian,
The slugs are:
artist
release
Relationship slug is:
artist-release
It is a many to many relationship but I guess the artist is the parent.
Thanks
Try this alternate syntax, designed to work in the new post relationships system:
[wpv-post-title item="@artist-release.parent"]
Okay so in the skin editor of the grid when I add that shortcode in the preview in The Grid plugin it comes up with the same artist for every release, which is of course not right. But when I look at it on a page it shows no artist at all.
May I log in and take a closer look? I'm not really familiar with The Grid.
How can I access the ID of the current post in a skin? Is there a shortcode or something? The Grid's documentation doesn't have a list of variables or shortcodes, and I don't see any information directly related to this.
Hi
The actual setup for how this grid works is here:
hidden link
Gris is called: New Release RECORDS Page Grid
What I sent before was the custom skin that I made where I added the shortcode.
The grid pulls in the custom posts from Releases. You can see that in the Source tab inside the grid settings from link above.
Chris
This doesn't help, sorry. I need to know how to access the ID of the current post, while in the skin editor area.
Okay, sorry the support is hard to find. I did find this in their developer notes:
// get the item ID
$tg_el->get_item_ID();
Does that help?
Here is link to that developer section
hidden link
I need a shortcode or placeholder or some code I can insert directly in the skin editor to get the ID of the current post in the Grid. If it's important to display related post information in the grid, I suggest you reach out to the developers or support team for The Grid to get a definite answer to this question:
How can I get the ID of the current grid post in a grid skin editor?
Okay, I contacted them, I will let you know what they say.
Thanks
Well that was quick here is what they said:
My content #post_ID#
Sorry forgot this
You can use text/HTML element add the post id like this:
My content #post_ID#