1

I am trying to create a view where a user doest have a certain content type.

Say for instance I have content types A, B and C and I only want to return results to show users who don’t have content type A but could have B or C.

I have created a view for (users) and linked it to the content authored. I have played about a bit but haven’t managed to find the correct filters. Can anyone help??

Many thanks

David

4
  • I am trying to create a list of users who don’t have content type A. not sure either of these answers sound like they would do the trick?
    – user30505
    Jul 1, 2014 at 7:33
  • It is not clear, what you want. Can you explain it better.
    – msmani
    Jul 1, 2014 at 8:06
  • I am setting up a review website. I have a content type called “Review”.I also have other content types called Hotel’s, Restaurants etc. The content type “Reviews” can reference all the other content types thus reviewing them.
    – user30505
    Jul 1, 2014 at 9:13
  • When a review is left, other users can vote on the review.A user is given a rating based on his average score (of votes) across all the reviews they have left.This might help visually yourreviews.com/reviewerrating. I want to give a beginners status to users who have not left any reviews. A user could have other content types though, i.e. they could have created a Hotel but not ended up reviewing it so the view must specifically show users who have not created any content types of “Review”.
    – user30505
    Jul 1, 2014 at 9:13

3 Answers 3

0

I am pretty sure what you need to do is set in the access permissions of the view to be permission: Publish Content

0

You could add all content types. If the user doesn't have that content type, they will not see output anyway.

0

You can do it in one of the following ways.

  1. Implement hook_views_query_alter() and alter the query to add the where clause.
  2. Or, Install Flag module
    • Create a user flag called Reviewer
    • Create a rule
      • Add a event : Content type Review is saved.
      • Condition : User is not flagged
      • Action : Flag the user
    • Now create your view and add relationship with Flags and add a filter User is not flagged
  3. Similar to step 2, but instead of flag assign a new role, reviewer, and in your view add a filter to check user does not have that role.
1
  • Being self taught in the last few months I think step 1 is beyond me however I can manage the flag module combined with rules which I’m already using on the site so I think I would look at that. Many thanks
    – user30505
    Jul 1, 2014 at 11:45

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.