Skip Navigation

[Resolved] Filter by relationship custom field not working

This support ticket is created 5 years, 7 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.

Sun Mon Tue Wed Thu Fri Sat
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10: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/Kolkata (GMT+05:30)

This topic contains 2 replies, has 2 voices.

Last updated by diamelaL 5 years, 7 months ago.

Assisted by: Minesh.

Author
Posts
#1355291
values-asigned.png
Screen Shot 2019-10-03 at 1.44.38 PM.png
Screen Shot 2019-10-03 at 1.37.02 PM.png
Screen Shot 2019-10-03 at 1.32.32 PM.png

I am trying to:
I have a relationship between "Plan de estudios (translation: it's like a career curriculum)" and "Cursos (translation: courses)".

I also have a custom field attached to the relationship between Cursos and Plan de estudios, called "cuatrimestre" (translation: quarter). This field is a select with 8 possible values, from 1 to 8.

In my Views, I'm trying to filter my courses by that "cuatrimestre" value, so I can have a view that only display courses corresponding to quarter 1, then another view that display all courses corresponding to quarter 2, etc. The problem is when I add that filter it returns no results. If I remove it, it returns all coursed. I've tried changing the comparison parameters, to compare strings with literal "1", just 1, or numbers with 1 but nothing works. Check Screen Shot 2019-10-03 at 1.44.38 PM.png

On the other hand, I also tried to print "cuatrimestre" value in the template area of the view but for some reason it returns an empty value, even when there is a value assigned in the actual posts. You can check this in screenshot: "values-asigned.png"

Link to a page where the issue can be seen:
hidden link

I expected to see:
Courses corresponding to the current Curriculum filtered by quarter.

Instead, I got: Screen Shot 2019-10-03 at 1.32.32 PM.png

#1355415

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

Can you please check now: hidden link

I've adjust your view to query the intermediary post type "Planes de Estudios Courses Intermediary Posts" because you are using many to many relationships as well as adjust the view's Loop Editor field:
=> hidden link

More info:
=> https://toolset.com/documentation/post-relationships/how-to-display-related-posts-with-toolset/#displaying-information-from-intermediary-post-types

#1356011

My issue is resolved now. Thank you very much!