webmaster@1
|
1 <?php |
webmaster@1
|
2 // $Id: search-result.tpl.php,v 1.1 2007/10/31 18:06:38 dries Exp $ |
webmaster@1
|
3 |
webmaster@1
|
4 /** |
webmaster@1
|
5 * @file search-result.tpl.php |
webmaster@1
|
6 * Default theme implementation for displaying a single search result. |
webmaster@1
|
7 * |
webmaster@1
|
8 * This template renders a single search result and is collected into |
webmaster@1
|
9 * search-results.tpl.php. This and the parent template are |
webmaster@1
|
10 * dependent to one another sharing the markup for definition lists. |
webmaster@1
|
11 * |
webmaster@1
|
12 * Available variables: |
webmaster@1
|
13 * - $url: URL of the result. |
webmaster@1
|
14 * - $title: Title of the result. |
webmaster@1
|
15 * - $snippet: A small preview of the result. Does not apply to user searches. |
webmaster@1
|
16 * - $info: String of all the meta information ready for print. Does not apply |
webmaster@1
|
17 * to user searches. |
webmaster@1
|
18 * - $info_split: Contains same data as $info split into a keyed array. |
webmaster@1
|
19 * - $type: The type of search, e.g., "node" or "user". |
webmaster@1
|
20 * |
webmaster@1
|
21 * Default keys within $info_split: |
webmaster@1
|
22 * - $info_split['type']: Node type. |
webmaster@1
|
23 * - $info_split['user']: Author of the node linked to users profile. Depends |
webmaster@1
|
24 * on permission. |
webmaster@1
|
25 * - $info_split['date']: Last update of the node. Short formatted. |
webmaster@1
|
26 * - $info_split['comment']: Number of comments output as "% comments", % |
webmaster@1
|
27 * being the count. Depends on comment.module. |
webmaster@1
|
28 * - $info_split['upload']: Number of attachments output as "% attachments", % |
webmaster@1
|
29 * being the count. Depends on upload.module. |
webmaster@1
|
30 * |
webmaster@1
|
31 * Since $info_split is keyed, a direct print of the item is possible. |
webmaster@1
|
32 * This array does not apply to user searches so it is recommended to check |
webmaster@1
|
33 * for their existance before printing. The default keys of 'type', 'user' and |
webmaster@1
|
34 * 'date' always exist for node searches. Modules may provide other data. |
webmaster@1
|
35 * |
webmaster@1
|
36 * <?php if (isset($info_split['comment'])) : ?> |
webmaster@1
|
37 * <span class="info-comment"> |
webmaster@1
|
38 * <?php print $info_split['comment']; ?> |
webmaster@1
|
39 * </span> |
webmaster@1
|
40 * <?php endif; ?> |
webmaster@1
|
41 * |
webmaster@1
|
42 * To check for all available data within $info_split, use the code below. |
webmaster@1
|
43 * |
webmaster@1
|
44 * <?php print '<pre>'. check_plain(print_r($info_split, 1)) .'</pre>'; ?> |
webmaster@1
|
45 * |
webmaster@1
|
46 * @see template_preprocess_search_result() |
webmaster@1
|
47 */ |
webmaster@1
|
48 ?> |
webmaster@1
|
49 <dt class="title"> |
webmaster@1
|
50 <a href="<?php print $url; ?>"><?php print $title; ?></a> |
webmaster@1
|
51 </dt> |
webmaster@1
|
52 <dd> |
webmaster@1
|
53 <?php if ($snippet) : ?> |
webmaster@1
|
54 <p class="search-snippet"><?php print $snippet; ?></p> |
webmaster@1
|
55 <?php endif; ?> |
webmaster@1
|
56 <?php if ($info) : ?> |
webmaster@1
|
57 <p class="search-info"><?php print $info; ?></p> |
webmaster@1
|
58 <?php endif; ?> |
webmaster@1
|
59 </dd> |