Hi,

Is it possible to make blocks visible to one (or multiple) specific user(s) without using roles? So when content is created the specific user can be defined.

Thanks

Comments

danylevskyi’s picture

Hi!
You can use PHP code to set block's visibility. While creating new block specify user ids.

global $user;
if ($user->uid = DESIRED_USER_ID) {
  return TRUE;  // block will be shown
}
return FALSE;

But I think it would be better to use roles for this task.

tomweil-1’s picture

Hi abarmot,
Thanks for that. Having thought about it a little, i think i need something a little different:
I need certain content items within a view to only display to selected users. So, ideally, when i create each piece of content i want to define the uid.
Is that possible? And if so, where would i input that?