If Jane Doe (Homeowner CPT) owns a home at 123 Any Street (Property CPT), and John Doe, another Homeowner also owns that same property with Jane; can I build a view where my query is of Homeowners, and for each row return:
Homeowner Name | Property | Other Owners
Jane Doe | 123 Any St | John Doe
Is this possible? I really need the query to focus on the Homeowner so I can export 1 homeowner per row, but I'd like to know the names of other homeowners that she has a relationship with via common relationship to a piece of property.
Your starting point is a Homeowner. You use a View to list their Properties. You want to display any other Homeowners of a given Property.
Well, the first step is to create another View that you insert into the View that displays the Properties that works in reverse, and shows the Homeowners who are related to the current Property.
Would that it were that simple, because that will show you all of the owners of the Property, which means repeating the Homeowner we started with.
I haven't implemented this to confirm it works, but this is how I think you can do it.
The first View, which lists Properties, is "aware" of the Homeowner in question. Try inserting a field using the Fields and Views button and in the post selection tab you'll be able to choose the related Homeowner. So we can get the Homeowner's post ID that way using the wpv-post-id shortcode (with the required attributes).
In the Loop Output section it will iterate over the Homeowners of that property, and you only want it to output the owner fields if it is not the owner passed as a shortcode attribute from the parent View.
I think that should work, but if you get stuck let me know.
Thanks! I will have to work on that solution sometime in the coming weeks. It will take some time to process. I will let you know if I run into trouble. Closing this ticket for now.