| 1 |
<?php
|
| 2 |
// $Id: similarterms.tpl.php,v 1.6 2008/07/12 23:18:55 rmiddle Exp $
|
| 3 |
|
| 4 |
/**
|
| 5 |
* @file
|
| 6 |
* simterms.tpl.ph
|
| 7 |
* Theme implementation to display a list of related content.
|
| 8 |
*
|
| 9 |
* Available variables:
|
| 10 |
* - $display_options:
|
| 11 |
* 'title_only' => 'Display titles only',
|
| 12 |
* 'teaser' => 'Display titles and teaser',
|
| 13 |
* - $items: the list.
|
| 14 |
*/
|
| 15 |
if ($items) {
|
| 16 |
$items_ls = array();
|
| 17 |
if ($display_options == 'title_only') {
|
| 18 |
foreach ($items as $node) {
|
| 19 |
$items_ls[] = l($node->title, 'node/'. $node->nid);
|
| 20 |
}
|
| 21 |
print theme('item_list', $items_ls);
|
| 22 |
}
|
| 23 |
if ($display_options == 'teaser') {
|
| 24 |
$output = '';
|
| 25 |
foreach ($items as $node) {
|
| 26 |
$output .= '<li>'. l($node->title, 'node/'. $node->nid);
|
| 27 |
$output .= ' - '. $node->teaser;
|
| 28 |
$output .= "</li>\n";
|
| 29 |
}
|
| 30 |
if ($output) {
|
| 31 |
echo "<ul>" . $output . "</ul>";
|
| 32 |
}
|
| 33 |
}
|
| 34 |
}
|