Posted by texas-bronius on December 27, 2010 at 8:26pm
See my code snippet and devel kpr() output:
<?php
function kresher_preprocess_node(&$vars, $hook) {
if (!$logged_in) {
kpr($vars);
$node = $vars['node'];
$node->field_story_body = '<p>You have to be subscribed to this website to see Premium Content. Sign up now?</p>';
}
...
?>I'm still trying to figure out how to hide or substitute the cck field's content before it's added to $content, but that's another matter. I just want to know why kpr() is spitting out $vars for me, and even showing $logged_in == TRUE for authenticated admin when my test should be demonstrating exactly the opposite: that only when $logged_in == FALSE should kpr() show (which of course it won't but you know what I'm getting at)..
Thanks, Merry Christmas!
-Bronius
| Attachment | Size |
|---|---|
| kpr-logged-in-true.png | 9.67 KB |
| not-logged_in-works-not.png | 20.97 KB |

Comments
did you mean
did you mean $vars['logged_in'] ?
..... :| ...
oh.
Right..
Thanks for the extra pair of eyes!