Skip Navigation

[Resolved] Checkboxes maximum options?

This support ticket is created 6 years, 6 months ago. There's a good chance that you are reading advice that it now obsolete.

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.

No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.

Sun Mon Tue Wed Thu Fri Sat
- 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 -
- 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 -

Supporter timezone: Europe/London (GMT+00:00)

This topic contains 17 replies, has 3 voices.

Last updated by fedeD-3 6 years, 5 months ago.

Assisted by: Nigel.

Author
Posts
#909320

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

OK, so the digit codes and the RD codes are not independent of each other as I thought.

I have a company with digit codes of, say, 01.01.01 and 20.20.20, and RD codes of R1, R5, R6, R9, R10, but according to the above it matters that the RD codes are connected to the digit codes.

I can't see anyway around this problem without writing a custom query solution, or going back to where we started, which is to make a hierarchical taxonomy that has the digit codes as the parent term and the RD codes as the child terms. But that means having to reproduce the RD codes for every digit code, which will not only be time-consuming to set up but will mean a messy UI when editing company posts.

The post relationship solution you proposed doesn't work because if your are querying (displaying) company posts then you can only filter by properties of companies and not by properties of something else. Filtering by the related posts (digit codes in your example) is possible because of some special handling for relationships within Views, but the RD codes in your setup belong to the intermediate post type used in the relationship, and not to companies, and so cannot be used to filter companies.

We will be adding support to filter by fields of related posts which would hopefully make it possible to filter by the fields of the intermediate posts, but I don't have a timetable for it, it is not imminent if you need it for a current project.

Sorry that it seems like we are going round in circles, but what you are trying to do is intrinsically difficult in the context of WordPress and the WP_Query class in particular which is what is used to retrieve posts from the database.

Right now your options would be to implement an entirely custom solution, or to use taxonomies and accept that once a user has chosen a digit code they may see RD codes that, if selected, will return no results.

#909329

Nigel
Supporter

Languages: English (English ) Spanish (Español )

Timezone: Europe/London (GMT+00:00)

Let me just point out one last thing that may help you when deciding how to proceed.

If you were only filtering by the digit code relationship and the RD relationship field and *not* by any other company field then this could work.

Your View would, instead of querying company posts, query the intermediate post type of the relationship.

You should then be able to add filters for the relationship with digit codes, and for the RD code custom field.

Then in the Loop Output, you specify that you want to display fields (such as post title with link) of the connected company posts, rather than of the intermediate posts themselves returned by the query.

On the front-end it *looks* like you are querying company posts, but you are actually querying the intermediate posts and displaying the linked company posts.

#911037

Hi Nigel,
thank you for your support. I found a (temporary, but more than accettable) solution.
I have created two filter:
- first filter: to find companies associated to a specific digit-code (hidden link)
- second filter: to find the connected companies to the association digit-code/RD-code (hidden link)