Can we allow registered users only to see full story content, but permit search engines and unregistered site visitors to see only story teasers?

Curtis

Comments

chx’s picture

I have not tested this, but should work

<?php
function teaseronly_perm() {
  return array('view full node');
}

function teaseronly_nodeapi($node, $op, $teaser) {
  if ($op == 'view' && !$teaser && !user_access('view full node')) {
    drupal_access_denied();
    exit;
  }
}
?>

save these lines into teaseronly.module and enjoy!
--
Read my developer blog on Drupal4hu.

--
Drupal development: making the world better, one patch at a time. | A bedroom without a teddy is like a face without a smile.

CLamont’s picture

Thanks, chx.

Greatly appreciated!

Curtis