1

I made so the logged in user have a recap of their last comments/added node on their profile with a view.
As I am making the profile page public, I need to be able to hide those blocks from others authenticated users.

How can I make the block visible to the user for which the profile page is?

0

So I found out :

  • Either you can directly go in view and add a "FILTER CRITERIA" > "(author) User: Current" and it will hide the content for user that are not the current logged in user
  • Or you can go in the block settings, select "Pages on which this PHP code returns TRUE (experts only)" and add in the box <?php global $user; return $user->uid == arg(1); ?> and the block disappear totally if you are not the current user.
| improve this answer | |

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.