I would like to switch off the green box status messages for unregistered and registered users...how does this work?

Comments

Anonymous’s picture

Remove $messages from page.tpl.php.

-----------------------------------------
Joep
CompuBase, Drupal websites and design

derekwebb1’s picture

Actually you would want to wrap output of the $messages in an if conditional like:

global $user;

if ($user->uid) {
if ($messages) { print $messages; }
}

You dont want to remove it altogether! It can provide some very useful info.

Admin only:

if ($user->uid == 1) {
if ($messages) { print $messages; }
}

Regards, Derek
http://collectivecolors.com

srbarnard’s picture

I can't tell you how long I was trying to figure out how to only view these green messages for admin.

All of my RSS feed updates were being listed in a long green notification message. horrible!

I am a little curious why this wouldn't be a setting but nothing's perfect.

Thanks for the help!

wolftmc’s picture

Hi, I am looking to do the same thing but not sure I have the php right. Did you apply this change to your page.tpl.php and get it to stop the box from poping up?

If so, could you copy what you did and post it here?

This is the section on my page.tpl.php from my theme where I think I need to place it but not sure.
*****

if ($content_top):
print $content_top;

endif;
if ($title):
print $title;

endif;
if ($tabs):

print $tabs;

endif;
print $help;
print $messages;
print $content;
print $feed_icons;
if ($content_bottom):

print $content_bottom;

endif;

********
Thank you!!!