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:
MISSION ACCOMPLISHED, so I thought …
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!
Sponsored by SupremePR