Does anybody know if there is a module / method of hiding certain text from a node so that only registered users see it....

But here's the catch, I want registered users to see it, but anons to not see it, but know it's there...

So basically I want to link to other content and want something like "You must login/register to see this content"

Any help or suggestions would be great as I can't see to find anything unless it's hiding somewhere lol

Comments

vm’s picture

We don't know what "part" of what "content" you want hidden. Some conditional php in your tpl.php file could d what you want. A generic example is located below.

<?php

  global $user;

  if (!$user->uid) {
    $hiddencontent .= '<div>'. t('Please <a href="@login">Login</a> or <a href="@register">Register</a> to view this content', array('@login' => url('user/login'), '@register' => url('user/register'))) .'</div>';

  }
  else {
        $hiddencontent .= '<div>'. t(ADD LOGGED IN CONTENT) .'</div>';
  }
?>

note the ADD LOGGED IN CONTENT

then print
print $hiddencontent in your tpl.php file

vsr’s picture

You can use modules to provide a teaser and they have to register to see rest, you can have certain parts avail to different levels of user using CCK fields You should look at the access control modules and decide how to construct your content.

nevets’s picture

How about the Premium module?

lagerassassin’s picture

Wow thanks for the awesome replies guys! this helps alot! thankyou!!!