Mercurial > hg > drupalISMI
diff 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 diff
--- a/mpiwgISMI/template.php Tue Feb 02 17:13:52 2016 +0100 +++ b/mpiwgISMI/template.php Thu Oct 06 10:27:58 2016 +0200 @@ -3,10 +3,29 @@ * Override or insert variables into the page template. */ function mpiwgISMI_preprocess_page(&$vars) { - // Move secondary tabs into a separate variable. - - - + // 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'; -} \ No newline at end of file +} + +/** + * 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'); +}