By pinkish on
Hi all,
I'm new at Drupal, and I'm hoping somebody can help me with this problem.
I created a block on the left sidebar, just under the Navigation block. This new block (lets call it "Registered Area") is to contain more menus for registered users only (logged in users only). So after I created the block, I enabled it. And in the configuration page, under Page specific visibility settings, I selected the PHP mode, and entered the following code:
global $user;
return (bool) $user->uid;
(As shown here http://drupal.org/node/64854)
However, the Registered Area block is still showing up to anon users! Even after reloading the page again.
Can anybody help? What am I doing wrong? Is there any other setting I'm supposed to do?
Thanks!
Comments
Overview-approach to block visibility
Try this page instead...
Overview-approach to block visibility
http://drupal.org/node/64135
Hello, I'm new to Drupal too
Hello,
I'm new to Drupal too and found you're question very intresting.
So I took a look at the node you mentioned above.
In the left menu on that page there was an item "Show block content only to certain roles - Drupal 4.7" that caught my eye.
(http://drupal.org/node/86241) and found some very different looking code. (Is it different or just another way to do the same thing?)
May be the whole chapter "PHP block visibility settings" starting from http://drupal.org/node/60317 will be helpfull for you.
I know it will for me :-) Thanks for letting me find this stuff.
Sincerely,
Bart
Enclose the code in <?php ?>
Enclose the code in <?php ?> quotes. Make sure that there is no leading or trailing whitespace.
--
The Manual | Troubleshooting FAQ | Tips for posting | How to report a security issue.
That's it!
That solves it! Thanks for that. I thought I was only supposed to put the code and not the tags as well.