I would like to display a specific message to users when they are previewing a node they are submitting. So I thought I would use a block with PHP code, using some info indicating that the node is being previewed. Unfortunately, I cannot get it working. I have tried these conditions:
if ($variables['view_mode'] == 'preview')
...
I get this error:
Notice : Undefined variable: variables in eval() (line 4 in /.../modules/php/php.module(80) : eval()'d code).
Tried this too:
if ($node->in_preview == TRUE)
...
I get these errors:
Notice : Undefined variable: node in eval() (line 5 in /.../php.module(80) : eval()'d code). Notice : Trying to get property of non-object in eval() (line 5 in /.../php.module(80) : eval()'d code).
I guess I have to declare the variable before, but how? I thought that since the node form is rendered anyway, the needed variable was available?