Skip Navigation

[Resolved] List with search and filter set up

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Karachi (GMT+05:00)

This topic contains 3 replies, has 2 voices.

Last updated by Waqar 1 month, 3 weeks ago.

Assigned support staff: Waqar.

Author
Posts
#2507563

Hello,

We have 3 CPT:
Location
Company
Based in

Many to Many relationsships:
Locations > Based in
Locations > Companies
Companies > Based in

How do we best create a page listing the above with search and filter?

#2508055

Waqar
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Hi,

Thank you for contacting us and I'd be happy to assist.

My understanding is that the main/central CPT in this setup is the 'Company' which will contain the post items that you'd like to search for through the filters.

If that is correct, I'll recommend using two custom taxonomies for the 'Location' and 'Based in' items, instead of the CPTs. This is because, in a view, only a single relationship filter can be used. This means that you'll be able to use the relationship search filter either for the "Companies <-> Locations" relationship or for the "Companies <-> Based in" relationship, but not both.

Whereas, if you'll join 'Location' and 'Based in' items to the "Companies" through their custom taxonomies, you'll be able to add search fields for both.

I hope this helps and please let me know if you need any further assistance with this.

regards,
Waqar

#2508117

Okay understood so you can only use one relationship search filter in a view. But can we still show results for the relationships without the search filter? Can we pull this all through into a content template using block editor?

We have already set up the 3 CPTs as we want to have sections for each and also use these in user profiles fields and various forms and other sections across the site.

#2510941

Waqar
Supporter

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Sorry about the delay in getting back on this, as we had an unusually busy forum queue after the weekend.

Yes, you can show the related post data in the view's results/loop items.

For cases, where only a single related post can exist ( e.g. one-to-one, one-to-many, etc ), you can select the related post in the dynamic source settings of the blocks.

In other cases, where multiple related posts can exist, you can create a classic/legacy view and show the related posts through that.
( nesting of blocks views inside another blocks views is not supported )