drupal-7rssdrupal-taxonomy

Drupal 7 add fields to show in RSS feed for taxonomy


iam having troubles with RSS feed. I have found that I can get feed for specific taxonomy just adding /feed after that taxonomy, but how is possible to add/remove fields from that, where can I found this "view" for this feed? Thank you


Solution

  • The callback is defined into hook_menu from taxonomy.module :

    $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',
      );
    

    it call function 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);
    }
    

    it call function node_feed into node.module line 2575

    So you can analyse those function to understand how it works and find solution