Hide block when logged in

Permalink 1 user found helpful
Ok, I've got some login warning messages and notices that I want to only show to people not logged in. Is this possible? Doesn't seem to work when I try. I found some old threads saying it won't work but want to verify before I go crazy.

jizzle
 
jizzle replied on at Permalink Reply
jizzle
I do know I can do this with a custom template... I just don't want to have to make em for a bunch of different blocks.

Maybe a custom template named "Hide when logged in" could be packaged with all the blocks? This would avoid the whole top down permission approach, yet provide this functionality easily.

EDIT: If anyone else is trying to do the same, here is a custom template from the Content block.

<?php 
   defined('C5_EXECUTE') or die(_("Access Denied."));
   $u = new User();
   global $c;
   $content = $controller->getContent();
   if ($c->isEditMode()) {  
      print $content;
   } else {
      if ($u -> isLoggedIn()) {
         //show nothing
      } else {
         print $content;
      }
   }
?>
ptheis replied on at Permalink Reply
ptheis
this works PERFECTLY!

thanks for the tip, this really solved a huge problem for me.
Mnkras replied on at Permalink Reply
Mnkras
take a look at the package Guest Views, its free, and you can request it for other blocks,

Mike