Tell us what you are trying to do?
I have 3 custom post types: coordinate, genesis and recipe.
Coordinate relates to genesis as one to many. Geneses [0 .. 1] << Coordinates [*]
Recipe relates to genesis as many to many. Recipes [*] << Recipes Geneses >> Geneses [*]
I want to show in the Coordinates template, a list of Recipes.
I can't configure the view to filter Recipes by the parent Genesis of Coordinate.
It is also not possible to have nested views.
Is there any documentation that you are following?
I saw several lessons and searched the forum but almost everything is simpler.
Is there a similar example that we can see?
My problem is really similar to this https://toolset.com/forums/topic/show-second-relationship-info/
I prefer to configure everything with the block editor if possible but I tried with the shortcodes in that theread and I could not achieve it anywway.
Hello. Thank you for contacting the Toolset support.
Can you please share problem URL and tell me what Coordinates single post you want to display the related Recipes that is connected to parent Geneses.
*** Please make a FULL BACKUP of your database and website.***
I would also eventually need to request temporary access (WP-Admin) to your site. Preferably to a test site where the problem has been replicated if possible in order to be of better help and check if some configurations might need to be changed.
I have set the next reply to private which means only you and I have access to it.
With the view block you added on your content template:
=> hidden link
As you can see with the following screenshot:
- hidden link
I've adjusted the view to query the intermediary post type "Recipes Geneses Intermediary Posts" and added the Query Filter for post relationship and set it to "Specific:"
Now, the "Specific:" will be the dyanamic value and that is hooked in using the view's hook "wpv_view_settings" that is added to "Custom Code" section:
=> hidden link
add_filter( 'wpv_view_settings', 'func_hookin_grand_parent_value', 10, 2 );
function func_hookin_grand_parent_value( $view_settings, $view_id ) {
global $post;
if ( $view_id == 72 ) {
$parent_id = toolset_get_related_post($post->ID,'coordinate-genesis');
$view_settings['post_relationship_id']=$parent_id;
}
return $view_settings;
}
I've removed the view block and the code added to "Custom Code" section.
Its better to use the classic view as this will also facilitate using nested view if required. So, I've created the following view in legacy mode:
=> hidden link
With above view I've added the Query Filter - to filter view results using the post-relationship filter with the view's shortcode attribute "wpvrelatedto":
Filter by post relationship or repeatable fields group owner
Select posts in a Recipes Geneses relationship that are related to the Post with ID set by the shortcode attribute wpvrelatedto.
eg. [wpv-view name="view-name" wpvrelatedto="123"]
You can adjust the "Loop Editor" section as required to display whatever content you want to display.
And I've added that view to your content template using the "Fields and Text" block as given under:
=> hidden link