forum-topic-list.tpl.php

  1. 7.x drupal/modules/forum/forum-topic-list.tpl.php
  2. 6.x drupal/modules/forum/forum-topic-list.tpl.php

Displays a list of forum topics.

Available variables:

  • $header: The table header. This is pre-generated with click-sorting information. If you need to change this, see template_preprocess_forum_topic_list().
  • $pager: The pager to display beneath the table.
  • $topics: An array of topics to be displayed. Each $topic in $topics contains:

    • $topic->icon: The icon to display.
    • $topic->moved: A flag to indicate whether the topic has been moved to another forum.
    • $topic->title: The title of the topic. Safe to output.
    • $topic->message: If the topic has been moved, this contains an explanation and a link.
    • $topic->zebra: 'even' or 'odd' string used for row class.
    • $topic->comment_count: The number of replies on this topic.
    • $topic->new_replies: A flag to indicate whether there are unread comments.
    • $topic->new_url: If there are unread replies, this is a link to them.
    • $topic->new_text: Text containing the translated, properly pluralized count.
    • $topic->created: A string representing when the topic was posted. Safe to output.
    • $topic->last_reply: An outputtable string representing when the topic was last replied to.
    • $topic->timestamp: The raw timestamp this topic was posted.
  • $topic_id: Numeric ID for the current forum topic.

See also

template_preprocess_forum_topic_list()

theme_forum_topic_list()

1 theme call to forum-topic-list.tpl.php
template_preprocess_forums in drupal/modules/forum/forum.module
Preprocesses variables for forums.tpl.php.
3 string references to the theme hook from forum-topic-list.tpl.php

Note: this list is generated by looking for the string for this theme hook, so it may include some references that are not actually using this theme hook.

forum_theme in drupal/modules/forum/forum.module
Implements hook_theme().
hook_theme in drupal/modules/system/system.api.php
Register a module (or theme's) theme implementations.
template_preprocess_forums in drupal/modules/forum/forum.module
Preprocesses variables for forums.tpl.php.

File

drupal/modules/forum/forum-topic-list.tpl.php
View source
  1. <?php
  2. /**
  3. * @file
  4. * Displays a list of forum topics.
  5. *
  6. * Available variables:
  7. * - $header: The table header. This is pre-generated with click-sorting
  8. * information. If you need to change this, see
  9. * template_preprocess_forum_topic_list().
  10. * - $pager: The pager to display beneath the table.
  11. * - $topics: An array of topics to be displayed. Each $topic in $topics
  12. * contains:
  13. * - $topic->icon: The icon to display.
  14. * - $topic->moved: A flag to indicate whether the topic has been moved to
  15. * another forum.
  16. * - $topic->title: The title of the topic. Safe to output.
  17. * - $topic->message: If the topic has been moved, this contains an
  18. * explanation and a link.
  19. * - $topic->zebra: 'even' or 'odd' string used for row class.
  20. * - $topic->comment_count: The number of replies on this topic.
  21. * - $topic->new_replies: A flag to indicate whether there are unread
  22. * comments.
  23. * - $topic->new_url: If there are unread replies, this is a link to them.
  24. * - $topic->new_text: Text containing the translated, properly pluralized
  25. * count.
  26. * - $topic->created: A string representing when the topic was posted. Safe
  27. * to output.
  28. * - $topic->last_reply: An outputtable string representing when the topic was
  29. * last replied to.
  30. * - $topic->timestamp: The raw timestamp this topic was posted.
  31. * - $topic_id: Numeric ID for the current forum topic.
  32. *
  33. * @see template_preprocess_forum_topic_list()
  34. * @see theme_forum_topic_list()
  35. *
  36. * @ingroup themeable
  37. */
  38. ?>
  39. <table id="forum-topic-<?php print $topic_id; ?>">
  40. <thead>
  41. <tr><?php print $header; ?></tr>
  42. </thead>
  43. <tbody>
  44. <?php foreach ($topics as $topic): ?>
  45. <tr class="<?php print $topic->zebra;?>">
  46. <td class="icon"><?php print $topic->icon; ?></td>
  47. <td class="title">
  48. <div>
  49. <?php print $topic->title; ?>
  50. </div>
  51. <div>
  52. <?php print $topic->created; ?>
  53. </div>
  54. </td>
  55. <?php if ($topic->moved): ?>
  56. <td colspan="3"><?php print $topic->message; ?></td>
  57. <?php else: ?>
  58. <td class="replies">
  59. <?php print $topic->comment_count; ?>
  60. <?php if ($topic->new_replies): ?>
  61. <br />
  62. <a href="<?php print $topic->new_url; ?>"><?php print $topic->new_text; ?></a>
  63. <?php endif; ?>
  64. </td>
  65. <td class="last-reply"><?php print $topic->last_reply; ?></td>
  66. <?php endif; ?>
  67. </tr>
  68. <?php endforeach; ?>
  69. </tbody>
  70. </table>
  71. <?php print $pager; ?>

Related topics