So I have a view and a filter with field x. I want this field x to be equal to the user ID of the current user.

When adding the filter I'm asked to insert a value, if I insert the value by hand, e.g. 1, the right content is displayed for that user. However, I wanna automate this system for the rest of the users.

I tried things like %uid in the value box but this doesn't seem to work.

any ideas?

I'm using Drupal 6 and Views 2.


There is a filter called User: Current which will "Filter the view to the currently logged in user."

|improve this answer|||||
  • That's not what I'm looking for. I have a custom table with uids. I want to say custom table: uid = user : current. – Danish Khan Aug 30 '11 at 13:40
  • Hmm, i'm still not sure that I understand the question. Could you add the User: Current filter and then add the User: Uid field? If not, I suggest expanding your original question. – Jukebox Aug 30 '11 at 13:54
  • okay so i have table A with all the users, table B with all the nodes and finally table C with 2 fields, uid and nid. Now, I have managed to read all the nodes in table C using the Data module which allows me to connect the field to the content type (all the nodes in table B). Now I just want to display the content which belongs to the current user logged in. User:current won't work because views doesn't know what uid is, it think its just some field. so i wanna add a filter which says, table C: uid = current user. – Danish Khan Aug 30 '11 at 14:00
  • 1
    Figured it out. Add the field in arguments and as a default value say get logged in user's ID. – Danish Khan Aug 31 '11 at 9:09

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.