Hi,
I have big problem. On my site www.edobit.com I have 4 roles and some blocks have to be visible only to anonymous users. So I check box on block Role specific visibility settings "Anonymous users", but block is still visible by all roles.
I don't have problem with premium module:
http://drupal.org/node/794438
Because I work with "Pemium content" module. (I tried to diseable it but no effect)
Please help...
Comments
Comment #1
mayank-kamothi commentedHi,drale01
write down PHP code in block in Show if the following PHP code returns TRUE (PHP-mode, experts only).
Comment #2
parasolx commentedwhat kind of block it is?
have you ever try to clear the cache before?
does the block derived from views? if true, check Views permission. Disable permission for "access all views" for all roles which it will override the block module if you enable it.
Comment #3
drale01 commentedThanks both of you mayankkamothi and parasolx.
Parasolx help me with blocks generated form views.
Mayankkamothi make good job about block that is not generated from views. But now this block is not shown on every page on site. So colud you write down php code with that change?
Comment #4
parasolx commented@drale01, in comment #1, it should only visible to specific role that you name in it. as example:
it will visible when your are not login. but when you login, it will hide as your role already change from anonymous to authenticated. and it also will hide in all pages since the variable use is base on roles (not page/URL specific).
if you want to add more than 2 roles, you can add this to the argument:
if (($user->role) == 'anonymous' || ($user->role) == 'roles01') {this will visible to user with roles "anonymous" OR "roles01". you can explore more by using other PHP operator such as "&&".
in comment #2, you need to specified the access in views edit. if you didn't set any restricted access, it will turn visible to all roles. but once you set, either one/two roles then it only can be access by that particular roles only.
Comment #5
mdupont