I am currently working on a project where I have three custom post types (CPTs): Design Firms, Communities, and Design Styles. I have set up many-to-many relationships between Design Firms and Communities, and between Design Firms and Design Styles.
I have created a page called "Search Design Styles", where I have a view showing posts of the Design Styles. When any of the design styles are selected it takes the user to the single page template for the Design Styles, On this template I have a view of the related Design Firms for that Design Style. This is working as expected.
However, I am trying to create a search filter on the single Design Style Template to further filter the Design Firms based on the Communities they belong to. I want the primary filter of the relationship between the Design Style and the Design Firm to remain intact, and give the user the further opportunity to filter the Design Firms by the Communities.
I have tried adding a search filter for Communities in the view, but it seems to override or ignore the primary filter of the relationship between the Design Style and the Design Firm. As a result, when a user lands on the single template page after choosing a specific style, they are shown all of the Design Firms, not just those related to the chosen style.
I would appreciate any guidance on how to achieve this.
Hi,
Thank you for contacting us and I'd be happy to assist.
Your observation is correct and using a relationship filter for two relationships at the same time is not supported.
Based on the structure you currently have, I understand you need to connect/link 'Design Firms' to 'Communities', as well as to 'Design Styles'.
A workaround can be to replace one of the relationship connections with a taxonomy. Instead of having 'Communities' as a custom post type, you can register it as a custom taxonomy, linked with the 'Design Firms'.
This way, on the single 'Design Styles' pages, you can add a view that has a relationship filter to show only the related 'Design Firms'. And you'll also be able to add a search field for the 'Communities' taxonomy.
I hope this helps and please let me know if you need further assistance.
regards,
Waqar