5 * Provide views data for forum.module.
9 * Implements hook_views_data().
11 function forum_views_data() {
13 $data['forum_index']['table']['group'] = t('Forum');
14 $data['forum_index']['table']['base'] = [
16 'title' => t('Forum content'),
17 'access query tag' => 'node_access',
20 $data['forum_index']['nid'] = [
22 'help' => t('The content ID of the forum index entry.'),
37 'base field' => 'nid',
42 $data['forum_index']['title'] = [
43 'title' => t('Title'),
44 'help' => t('The content title.'),
47 'link_to_node default' => TRUE,
60 $data['forum_index']['tid'] = [
61 'title' => t('Has taxonomy term ID'),
62 'help' => t('Display content if it has the selected taxonomy terms.'),
64 'id' => 'taxonomy_index_tid',
65 'name table' => 'taxonomy_term_data',
66 'name field' => 'name',
67 'empty field name' => t('Uncategorized'),
69 'skip base' => 'taxonomy_term_data',
75 'title' => t('Has taxonomy term'),
76 'id' => 'taxonomy_index_tid',
77 'hierarchy table' => 'taxonomy_term_hierarchy',
79 'skip base' => 'taxonomy_term_data',
80 'allow empty' => TRUE,
83 'base' => 'taxonomy_term',
84 'base field' => 'tid',
89 $data['forum_index']['created'] = [
90 'title' => t('Post date'),
91 'help' => t('The date the content was posted.'),
103 $data['forum_index']['sticky'] = [
104 'title' => t('Sticky'),
105 'help' => t('Whether or not the content is sticky.'),
108 'click sortable' => TRUE,
109 'output formats' => [
110 'sticky' => [t('Sticky'), t('Not sticky')],
115 'label' => t('Sticky'),
120 'help' => t('Whether or not the content is sticky. To list sticky content first, set this to descending.'),
124 $data['forum_index']['last_comment_timestamp'] = [
125 'title' => t('Last comment time'),
126 'help' => t('Date and time of when the last comment was posted.'),
128 'id' => 'comment_last_timestamp',
138 $data['forum_index']['comment_count'] = [
139 'title' => t('Comment count'),
140 'help' => t('The number of comments a node has.'),