0

I use D7. I have a view which I want to show only current user. Those fields, in the view, are related to the current user via relationship of Profile. So, I can also say that the current user can view their own profile's fields.

So, I set 'User: Uid' as 'User ID from logged in user' on contextual filer. But, if I write non-current user's uid after page's path(Let's say '/test-user') like '/test-user/100', it outputs that user's(uid=100) fields.Even if I set 'global $user; return $user->uid;' with PHP Code for User: Uid instead, I got the same result.

For some reason, with Field Permission module, I set those fields as 'View anyone's value for field_name'. So, I have to control the visibility in this view somehow.

Can anybody give me some advice? Thank you.

0

Found the solution. Actually this doesn't disable a context from URL. But it worked for my demand.

Click 'add' under Filter criteria. ->Select 'User: Current'. ->Select 'Is the logged in user' as 'Yes'.

That's all.

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.