0

I have two profile types teacher and students. They both have a taxonomy field “State”.

Below each teacher’s profile I want to show students from his State.

I have added two relationships:

1) User: Profile 2) Field: State (which is a taxonomy term field).

Then added a contextual filter Taxonomy term: Term ID. Under "When the filter value is NOT available" have selected default value "Taxonomy term id from url".

But it doesn't displays any matching profiles. I have done similar functionality for content entity type and it works. I guess the problem is due to profile entity type or am I missing something?

Can you please tell where I am going wrong? Thanks!

0

I think the problem lies in your contextual filter. Presumably the teacher's profile page does not contain the taxonomy term ID in the URL, it usually doesn't unless you've done something tricky to put it there.

So: the view is looking at yoursite/user/[uid] and it thinks that the [uid] is the taxonomy term id (because you told it so), so doesn't find any matches and returns a nil result.

I'm not sure how to fix that, but hopefully this will help you troubleshoot.

| improve this answer | |
  • Yes, I also feel that taxonomy does not save profile terms. Because if I go to the term page then I don't see profiles listed there. In my quest to find answer I came across this module drupal.org/project/taxonomy_entity_index. But installing it and indexing didn't helped. Maybe I need to apply a different approach. – Imran Khan Sep 6 '14 at 14:28
  • I think it more likely that the term page doesn't show profiles because it is configured to show nodes and profiles aren't nodes. – Darvanen Sep 6 '14 at 23:29
  • Yes, that's right. Do you have any other idea by which this can be accomplished? – Imran Khan Sep 7 '14 at 5:42
  • Yes, make a new view that has similar settings to the term page except that it displays profiles instead of nodes. You should be able to clone the term page and then change the setting under format -> show from 'nodes' to 'profiles' or even 'fields', then play around with the results. – Darvanen Sep 7 '14 at 5:53
  • I know it already works for "content" views type. I have it functioning on other sites I have developed. The problem i am facing is for "user" type views. – Imran Khan Sep 7 '14 at 6:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.