0

I try to solve question - answer scenario with views.

2 content types: question and answer. (answer is connected to question by entityreference)
User can check themes of interests (taxonomy) in profile and a view is displayed in his profile with relevant questions.
Creating this view was simple: I made a user view with UID as contextual filter and added a entity reference relationship and taxonomy term:content with term. Then it is easy to display list of relevant questions.

Problem: I want to filter out questions already answered by current user. In other words - to filter out all questions which are referenced from answer content type and answer's author is current user.

I tried to add new relationship - content referencing content from xy field, tried to add contextual filter - node author. None of this seems to work.

EDIT: adding contextual filter user:author with excluded option works ONLY if there is reference (answer) made by current user. If other content(answer) by other user is referencing the content(question), it shows the question in the list again. Of course, because context filter only removes current user's nodes.

I need views to exclude content by other users as well. Does someone know answer to this? thank you

1 Answer 1

0

Try this,

  1. Add a contextual filter of Content: Author uid.
  2. Under "WHEN THE FILTER VALUE IS NOT AVAILABLE", select "provide default value", and then select "User ID from logged in user".
  3. Under MORE, select "Exclude".
  4. Save.

P.S. This should work. Haven't tried myself.

1
  • Hi, I tried it before. Problem is that it works if there is only one user with answer. If more than 1 content is referencing back (answers from more users) then it shows again in the list.
    – loparr
    Commented Jun 8, 2014 at 13:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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