1

I'm newish to drupal and it seems like this should be somewhat straightforward or at least possible with views and/or taxonomy.

I have an embedded video content type. I want to tag multiple users in a hidden field (as if they were taxonomy terms). The desired result is that a user can go to a URL like /videos/my-classes and it will list all the videos they are tagged in.

I've been reading the following thread, but there doesn't appear to be any applicable options when I try adding a views relationship. I'm looking for an option like "Video Embed: User" or something. I tried adding a user entity reference to the content type, but that didn't seem to help.

Thread: Display content with Taxonomy on User and Content matching

What I am trying to avoid is having the user go to /videos/username but instead /video/my-videos which displays different content for each user.

I'm not opposed to writing a code snippet for my theme, but it seems like there's a solution to this given the tools I already have.

0

This task can be done in the next way:

  1. Download References module
  2. Install User Reference module from this package
  3. Add User reference field to your content type
  4. It the view, that will display videos add a Contextual filter by created earlier user reference field
  5. In the filter settings choose "Provide default value" -> "User ID from logged in user"
  • Great! This did the trick. I installed the module, added a User Reference field to the video embed content type (just like a taxonomy term!). Then I created a new view for content of type video embed, added a contextual filter for the currently logged in user as you said, and I also added a required relationship for the field name. Works perfect! Thank you :) – OnNIX Jul 25 '15 at 1:26
0

It sounds to me that you might be looking for the Entity Reference module, which provides a field type that can reference arbitrary entities. "Users" could be a sample of such entities. This should work to implement the workflow you described in your question, which is something like "you" want to be abe to "tag" selected users for a given video.

However, as per the "The desired result is that a user can go to a URL like /videos/my-classes and it will list all the videos they are tagged in." in your question, you might also (or as an alternative?) want to consider the option where each user can indicate that they think they should be "tagged" for some video. In Drupal you could do this (easily) using the Flag module ... Think of something like a user who can "bookmark" the videos for which they select to do so.

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.