How do I append something to a node when it's in detail page I'm writing a module that appends content to a node. I'm doing this using hook_process_node :

function mymodule_preprocess_node(&amp;$variables) {
  $variables['content']['body'][0]['#markup'] .= '&lt;p&gt;My content&lt;/p&gt;'; 
}


How can I put a condition here to tell Drupal to only append content when the node is being displayed on a detail page, i.e. not in an index page?
If by "detail page" you mean the full node page, you can check the current view mode:

if ($variables['view_mode'] == 'full') {
  // ...
}