[ Index ]

PHP Cross Reference of Drupal 6 (yi-drupal)

title

Body

[close]

/modules/search/ -> search-result.tpl.php (source)

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


Generated: Mon Jul 9 18:01:44 2012 Cross-referenced by PHPXref 0.7