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

问题描述 投票:0回答:1

可能无法使用RSS feed。我发现可以在特定分类法之后添加/ feed来获取特定分类法的提要,但是如何从中添加/删除字段,在哪里可以找到该提要的“视图”?谢谢

drupal-7 rss drupal-taxonomy
1个回答
0
投票

回调从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行

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

© www.soinside.com 2019 - 2024. All rights reserved.