Drupal 7 添加字段以在 RSS 提要中显示以进行分类

Drupal 7 add fields to show in RSS feed for taxonomy

我在使用 RSS 提要时遇到了问题。我发现我可以获得特定分类法的提要,只需在该分类法之后添加 /feed,但是如何才能从中获得 add/remove 字段,我在哪里可以找到该提要的 "view"? 谢谢

回调从 taxonomy.module 定义到 hook_menu :

$items['taxonomy/term/%taxonomy_term/feed'] = array(
    'title' => 'Taxonomy term',
    'title callback' => 'taxonomy_term_title',
    'title arguments' => array(2),
    'page callback' => 'taxonomy_term_feed',
    'page arguments' => array(2),
    'access arguments' => array('access content'),
    'type' => MENU_CALLBACK,
    'file' => 'taxonomy.pages.inc',
  );

它调用函数taxonomy_term_feed

function taxonomy_term_feed($term) {
  $channel['link'] = url('taxonomy/term/' . $term->tid, array('absolute' => TRUE));
  $channel['title'] = variable_get('site_name', 'Drupal') . ' - ' . $term->name;
  // Only display the description if we have a single term, to avoid clutter and confusion.
  // HTML will be removed from feed description.
  $channel['description'] = check_markup($term->description, $term->format, '', TRUE);
  $nids = taxonomy_select_nodes($term->tid, FALSE, variable_get('feed_default_items', 10));

  node_feed($nids, $channel);
}

它将函数 node_feed 调用到 node.module 行 2575

因此您可以分析这些函数以了解其工作原理并找到解决方案