Add link to news data
/*
* Implements hook_preprocess_node
*/
function theme_preprocess_node(&$variables, $hook) {
switch ($variables['type']) {
case 'news':
// ADD LINK TO NEWS DATA - HOMEPAGE
if($variables['teaser'] == true && isset($variables['content']['title']['#items']['0']['value'])) {
// GET NODE TITLE, DATE AND NODE URL
$orgdate = $variables['content']['post_date']['#items']['0']['value'];
$orgtitle = strip_tags($variables['content']['title']['#items']['0']['value']);
$linktonode = $variables['node_url'];
// NEW TITLE + DATE VARIABLE
$newtitle = '<div class="teasertitle">' . $orgtitle . '</div> <div class="teaserdate">'. $orgdate.'</div>';
// ADD NODE URL TO DATE
$variables['content']['title']['0']['#markup'] = '<a href="'. $linktonode .'" class="title-date">'. $newtitle .'</a>';
}
break;
}
}