view mpiwgISMI/template.php @ 37:eccbb6239b89

custom search results for bibliography.
author casties
date Thu, 06 Oct 2016 10:27:58 +0200
parents 5148098e96a4
children
line wrap: on
line source

<?php 
/**
 * Override or insert variables into the page template.
 */
function mpiwgISMI_preprocess_page(&$vars) {
	// Move secondary tabs into a separate variable.
	$vars['MPIWGlogo'] = base_path() . path_to_theme() . '/logoMPIWG.png';
	$vars['MCGilllogo'] = base_path() . path_to_theme() . '/bannerMcGill-100.gif';
}

/**
 * Override or insert variables into the search result template.
 * 
 * @param unknown $variables
 */
function mpiwgISMI_preprocess_search_result(&$variables) {
	// biblio style
	$base = 'biblio';
	$style = 'chicago-fullnote-bibliography.csl';
	
	// get the search result node
	$result = $variables['result'];
	$r_node = $result['node'];
	// load the real node
	$node = node_load($r_node->entity_id);
	
	// render the node and pass it to search-result.tpl
	$render_args = array('#theme' => 'biblio_style', '#node' => $node, '#base' => $base, '#style_name' => $style);
	$variables['bib_render']= drupal_render($render_args);
	//$variables['bib_render'] = node_view($node, 'teaser');
}