3

I'm using Drupal 7.38 with the Flag (v7.x-3.6) module, along with Views. I'm setting up a flag for content.

My goal is to display a list of users whom are flagging content (along with aggregated count of number of items flagged). With the desired ULTIMATE goal of being able to click on the user's NAME (not UID!) and seeing all the content that the selected user has flagged.

After much research and advice, I was able to eventually accomplish this! The solution was that I had to set up 2 views:

  • one being a content view.
  • and the other one being a user view.

Some more details about these views:

  • Each of these views with properly configured relationships and contextual filters).
  • Only after using 'Rewrite Results' field on the user view (shown below). - Redirecting the output field as a link to the path created by the content view displaying the correctly associated users flagged content.

Here is a screenprint of the 'Rewrite Results' in my User view:

http://webstadium.com/sites/default/files/rewrite-results.jpg

MISSION ACCOMPLISHED, so I thought ...

enter image description here

However, this is all fine and dandy with 1 problem: when landing into the URL which contains a nice display of the content flagged by the user that was just clicked, I have no way (or 'know' of no way) to successfully migrate the user name into the header of this new page! Labeling & confirming the content now in front of them. So after clicking on a user name with flagged count of content, you land on a nice page of content, but it's unlabeled!

I need to somehow pass, to the new page, the UID (not logged-in!) of the user that was just selected by clicking on the user's name. I cannot figure out how to do.

I tried using the Token Filter module to place the variable into a custom block heading the new page, but it did not work (Token Type not supported).

Any help, hints or suggestions would be highly appreciated!

  • I just did a major reformatting of your (interesting) question, and removed quite some phrasing which I believe did not really help to understand your looooooooooooong question. In doing so, I have tried to not change the actual content (relevant details) of your question. All this hoping that it will help others to digest your question with a bit less effort, so that you will get an answer soon. Please review my edited version, and further correct anything that you think needs furthere refinement. PS (my 2 cents): I'm not convinced yet that you need 2 views (but need to think AbitMORE ...) – Pierre.Vriens Jul 28 '15 at 6:34
  • Pierre, Thank You for taking the time to do this, And quite well I might Add. I really have to learn to control my rambling, when I write. Your MUCH NEED edit Looks perfectly fine to me, I just would like to Add a second Image of the view created, right before the click-through to page that contains my "problem" I am New to stackExchange so please forgive me if I am not following the proper protocol of responding etc. Thanks Again for your time, Sincerely, Frank – frankwebstadium Jul 28 '15 at 14:58
  • Thanks for the feedback, glad you seem to like my refinements. Please go ahead with that 2nd image, or anything else that you think may help to better understand your question ... PS 1: I can't "upvote" it anymore (I already did ...). PS 2: the real answer to your question might be something using a field with "exclude from display" (need more time to figure that out ...) – Pierre.Vriens Jul 28 '15 at 15:01
  • Thanks Again for your valuable time Pierre, the reason for 2 Views is that the user view (found here: drupal.org/node/862486) – frankwebstadium Jul 29 '15 at 1:23
  • Thanks Again for your valuable time Pierre, the reason for 2 Views is that the user view (build instructions found here: drupal.org/node/862486) doesn't generate a display of content, only a list of users with flagged content, and the number of items... the user name is visible in this view but it only clicks through to user profile page. So this view (user) provides the info in a list format I'm after, Name & Number of flagged items -WHILE- the Content View allows me to Generate a list of content flagged by Particular Users but (cont) – frankwebstadium Jul 29 '15 at 1:38
0

I had the same issue where I wanted to show the title of the content flagged with a certain flag by each user. I solved it as follows:

  1. Created 2 views - 1 of users and another of content
  2. In the user view, add 'Flags: User's flaggings' relationship (Refer attachment user_view) user_view
  3. In the content view, add 'Flags: Node flag' relationship and 'Flags: User uid' contextual filter (Refer attachment content_view) content_view
  4. Select 'Display contents of "No results found"' for 'WHEN THE FILTER VALUE IS NOT IN THE URL' in the contextual filter added in step 3
  5. Set the format of the content view as 'Unformatted list' and uncheck 'Create a label' option for the 'Content: Title' field
  6. Install Views Field View module
  7. Embedd the content view inside the user view as a field by passing uid as a contextual filter to the content view

Hope this helps someone.

Regards,

Supriya Rajgopal

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.