Mercurial > hg > drupalISMI
comparison mpiwgISMI/template.php @ 37:eccbb6239b89
custom search results for bibliography.
author | casties |
---|---|
date | Thu, 06 Oct 2016 10:27:58 +0200 |
parents | 5148098e96a4 |
children |
comparison
equal
deleted
inserted
replaced
36:9a9a6da1d415 | 37:eccbb6239b89 |
---|---|
1 <?php | 1 <?php |
2 /** | 2 /** |
3 * Override or insert variables into the page template. | 3 * Override or insert variables into the page template. |
4 */ | 4 */ |
5 function mpiwgISMI_preprocess_page(&$vars) { | 5 function mpiwgISMI_preprocess_page(&$vars) { |
6 // Move secondary tabs into a separate variable. | 6 // Move secondary tabs into a separate variable. |
7 | |
8 | |
9 | |
10 $vars['MPIWGlogo'] = base_path() . path_to_theme() . '/logoMPIWG.png'; | 7 $vars['MPIWGlogo'] = base_path() . path_to_theme() . '/logoMPIWG.png'; |
11 $vars['MCGilllogo'] = base_path() . path_to_theme() . '/bannerMcGill-100.gif'; | 8 $vars['MCGilllogo'] = base_path() . path_to_theme() . '/bannerMcGill-100.gif'; |
12 } | 9 } |
10 | |
11 /** | |
12 * Override or insert variables into the search result template. | |
13 * | |
14 * @param unknown $variables | |
15 */ | |
16 function mpiwgISMI_preprocess_search_result(&$variables) { | |
17 // biblio style | |
18 $base = 'biblio'; | |
19 $style = 'chicago-fullnote-bibliography.csl'; | |
20 | |
21 // get the search result node | |
22 $result = $variables['result']; | |
23 $r_node = $result['node']; | |
24 // load the real node | |
25 $node = node_load($r_node->entity_id); | |
26 | |
27 // render the node and pass it to search-result.tpl | |
28 $render_args = array('#theme' => 'biblio_style', '#node' => $node, '#base' => $base, '#style_name' => $style); | |
29 $variables['bib_render']= drupal_render($render_args); | |
30 //$variables['bib_render'] = node_view($node, 'teaser'); | |
31 } |