By famo on
i was looking for a way to show a block for anonymous users only... so i found this code from the hand books and tried it...
//
global $user;
if (!$user->uid) : This content will be visible only to anonymous users.
else {
return;
}
endif;
//
but still this is not working and showing an error..
do you know a better way? another way to make a block that shows only to the anonymous users...
Comments
your code..
your code doesn't look right famo...try ALL these steps:
hope that helps
Dub
Currently in Switzerland working as an Application Developer with UBS Investment Bank...using Drupal 7 and lots of swiss chocolate
it's not working
the code is working now.. and i can use this block to post lists and write text but i cannot add a link...
i want it to be able to show a link but it's not working.
check how i've changed
///
///
it's not working and so i got this error
Parse error: parse error in c:\web\site\includes\common.inc(1813) : eval()'d code on line 4
it's not working
the code is working now.. and i can use this block to post lists and write text but i cannot add a link...
i want it to be able to show a link but it's not working.
check how i've changed
///
///
it's not working and so i got this error
Parse error: parse error in c:\web\site\includes\common.inc(1813) : eval()'d code on line 4
try this
note that you have to comment out the quotes
\".hope that helps..
Dub
Currently in Switzerland working as an Application Developer with UBS Investment Bank...using Drupal 7 and lots of swiss chocolate
it worked..
that helps... exactely what i want..
thanks dub :)
i don't understand
i don't understand why the block name appears when the user loged in?
the content of the block appears to the anonymous users only, that's good, but when the user log in the name of the block appears and i dont want its name to appear...
can you tell me how to hide the name of the block when the user logs in?
do you know how to help me
do you know how to help me in this : not to let the block name appear even when its content is not visible to the loged in user?