Add custom text to certain pages To add custom text to a node I have a code like this:

function mymodule_node_view($node, $view_mode, $langcode) {
  $var=....;
  if (.....) ){
      $node-&gt;content['new'] = array(
       '#markup' =&gt; $var,
     );
  }
}


It works perfectly, but now I need to add this text to pages that don't load any node. So I can't use this hook.

I mean something like the drupal_set_message function, showing custom text at the top of certain pages.
maybe you can add this to your if condition:

if($view_mode == 'full' &amp;&amp; node_is_page($node)){
   //your code here
 }