Add content to a render array in a content type from my custom module I created a content type that is used to display a list of videos hosted on brightcove. I have a module that is setting a cookie for the anonymous user when they watch one. My end goal is to display a viewed/unviewed icon for the user on the list.

I have all the data I need in the cookie. I just need to create a module that reads the cookie data and edits the render array for the content type. The issue is I am not sure how to add new values to that content type's render array. Is there a hook I can use to get access to the specific content type to add a key/value for viewed/unviewed? This is for drupal 7.

Thanks for the help.
hook_node_view() was made for exactly that:


  Act on a node that is being assembled before rendering.


e.g.

function MYMODULE_node_view($node, $view_mode, $langcode) {
  if ($node-&gt;type == 'my_type' &amp;&amp; $view_mode == 'full') {
    if (in_array($node-&gt;nid, $_SESSION['viewed_videos'])) {
      $node-&gt;content['viewed'] = array(
        '#markup' =&gt; t('You have viewed this video'),
        '#weight' =&gt; 10,
      );
    }
  }
}