This is a follow-up to How to show nodes where the user is (not) in the reference field with Views?
I have a node with multiple user references and need a node VIEW that hides all nodes where the current user is NOT referenced. So, if the current user is not referenced, the node should not show up. The problem I just can't solve is that the node still shows up when other user are referenced (using exclude, it only excludes the current user from display, but it still displays the nodes for each other user that is referenced). I have unsuccessfully tried views_distinct module and VIEWs own "distinct" query settings.
If the user is referenced, the node should show up (this works from the above mentioned question)
Basically, it’s for a simple pay-per-view site. I need 1 (or 2, whatever works) VIEWS that shows the videos where the user has purchased access to (where he is referenced) and where the user has not purchased access to (where he is not referenced). After 48 hours the references are removed using rules scheduler.
Ideally in one VIEW, when the user is referenced, the link should be „watch“, where the user is not referenced, it should read „buy“ using VIEWS conditional and rules link. But two separate VIEWS are also ok.
Right now I have a content view (also tried it with a user view unsuccessfully, but this might be a saner approach?!). All of that works well with the notable exception of showing the nodes with multiple user references.
Added a screenshot using the views argument substitutions.
I tried it with regExpressions and views substitutions. The UID of the currently logged in user is passed as !1, but what is the correct regEx syntax to show only the nodes, where this user is not referenced?
This does not work as value of the operator on the useraccess field filter:
Oh boy, this was a ride. Finally figured out a solution. Posting it if someone needs it. Basically, I added the username in the url and do a contains text comparison using views conditional. ID from the logged in user did not work as contains also shows user ID "13" or "14" when the user "1" is logged in. Simply excluding did not work in those cases where other users are referenced as well.