I have set up a many-to-many relationship with four CPTs, for example:
CDs, DVDs and Singers are all parents of Contributor (where Contributor is the intermediary post type).
So... a Singer can contribute to multiple CDs and multiple DVDs and a CD or DVD can have many singers.
I have set up a view to list all the Singers on a CD and inserted it into a content template for a CD. This works fine. I do this by setting the content selection to Contributor, filtering by Post Relationship: Post is child of 'Post where the view is inserted' and in the wpv-loop display the title with the id="$singer". All good. e.g.
So, now I want to list all the CDs and DVDs for a Singer with links to the respective CDs or DVDs. I do not want to display the Contributor title but the title of the CD or DVD CPT. This is where I have a problem.
I have set up a view to list all CDs and DVDs. I have set the content selection to Contributor filtering by Post Relationship: Post is child of 'Post where the view is inserted'. I get the correct message under the filter: "Post type Contributor is a child of CD, DVD and Singer post types".
In the wpv-loop I tried using the id="$parent" as follows:
I have another idea for you, let's see if it works for you.
1) Make Contributor parent of all post types. So will be stored in each child a custom field called "_wpcf_belongs_contributor_id" which will be the ID of the intermediary post type
2) Now let's create a view that will be displayed in the Singer Content Template
3) This view will display CD and DVD post type
4) Now let's insert a filter in functions.php to show only posts with the same "_wpcf_belongs_post_id" meta field value. Here you go:
Thanks too! 🙂 Really enjoying using Types Toolset. I think it's worth pointing out in the documentation to use slug names without hyphens. I did report this and it might get fixed but it caught me out again - lol. I have now changed all slugs to single words.