By Rosamunda on
Hi there!
I want to show error messages only to users that are admins.
I know that I can do something like <?php if($is_admin):?> <?php print $messages;?> <?php endif; ?> .
But that way I would avoid all kind of messages to be shown to normal users, and I want only to hide error messages.
Could it work with something like: if($is_admin && $type = 'error'): ... ?
Thanks in advance for your help!!
Rosamunda
Comments
Not exactly what you're asking for...
...but you can (and should, on a production site) change the settings at admin/settings/error-reporting to write errors to the log only (not to the screen).
Hi! Thanks for your anwser. I
Hi! Thanks for your anwser. I know but I like as admin to see the arreros in the screen too, but I don´t want my users to see them... :)
That´s why I thougth that I could do a little trick in the TPL.
Put this in template.php
THANKS!!
I see, not inside the TPL...
THANKS! BIG THANKS!!
Rosamunda
Thanks
Thanks
I typically use a php if $tabs in my page.tpl.php
This code works great but if you don't want to edit your template.php file, you can always just wrap the print $message code in a php if statement.
This will make sure that only people that have the permission to edit the page will be able to see the messages.