Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7187299
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T18:48:53+00:00 2026-05-28T18:48:53+00:00

I have a content type Audio which includes an audio file field. This field

  • 0

I have a content type “Audio” which includes an audio file field. This field accepts multiple values, so each node could contain any number of audio files. Ordinarily, when you build an RSS feed view, it will generate one <item> per node, and each of those will have multiple <enclosure> entries, one per audio file. But for my purposes I need the view to output a separate <item> for each of the audio file values. So if, for example, there are 3 audio files in a selected node, the whole node will be repeated in the feed 3 times, and each one will contain only one audio file enclosure.

The reason for this is that in my specific case, I’m using hook_node_view() in a custom module to add MRSS tags to each of the nodes that the view generates. So rather than the audio files being wrapped by <enclosure> they’ll be wrapped in <media:content> tags. According to the MRSS specification, you shouldn’t have more than one <media:content> entry per <item> unless they represent the same content. This is because the other tags like <title> and <description> pertain to all of the <media:content> tags in the same <item>. Ironically enough, the customization hook is the easiest part, but first I need to get the view to output the nodes in the manner I’ve described.

So is there some way I can use the new Drupal 7 views grouping feature or some other method to generate the output I’m looking for? I’d love to know the trick! Otherwise I’ll have to use a custom menu entry and lose all the advantages (such as automatic caching and being able to work within the Views UI) that I get with Views.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T18:48:54+00:00Added an answer on May 28, 2026 at 6:48 pm

    Create a view of “files” and then under the Advanced collapsed fieldset on the right side of the Views UI, create a relationship (a join) of the node with the file.

    Here’s a quick view you can copy here and import into your views ui:

    <?php
        $view = new view;
        $view->name = 'test';
        $view->description = '';
        $view->tag = 'default';
        $view->base_table = 'file_managed';
        $view->human_name = 'test';
        $view->core = 7;
        $view->api_version = '3.0';
        $view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */
    
        /* Display: Master */
        $handler = $view->new_display('default', 'Master', 'default');
        $handler->display->display_options['title'] = 'test';
        $handler->display->display_options['access']['type'] = 'perm';
        $handler->display->display_options['cache']['type'] = 'none';
        $handler->display->display_options['query']['type'] = 'views_query';
        $handler->display->display_options['query']['options']['query_comment'] = FALSE;
        $handler->display->display_options['exposed_form']['type'] = 'basic';
        $handler->display->display_options['pager']['type'] = 'full';
        $handler->display->display_options['pager']['options']['items_per_page'] = '10';
        $handler->display->display_options['style_plugin'] = 'default';
        $handler->display->display_options['row_plugin'] = 'fields';
        /* Relationship: File Usage: Content */
        $handler->display->display_options['relationships']['file_to_node']['id'] = 'file_to_node';
        $handler->display->display_options['relationships']['file_to_node']['table'] = 'file_usage';
        $handler->display->display_options['relationships']['file_to_node']['field'] = 'file_to_node';
        $handler->display->display_options['relationships']['file_to_node']['required'] = 0;
        /* Field: File: Name */
        $handler->display->display_options['fields']['filename']['id'] = 'filename';
        $handler->display->display_options['fields']['filename']['table'] = 'file_managed';
        $handler->display->display_options['fields']['filename']['field'] = 'filename';
        $handler->display->display_options['fields']['filename']['label'] = '';
        $handler->display->display_options['fields']['filename']['alter']['alter_text'] = 0;
        $handler->display->display_options['fields']['filename']['alter']['make_link'] = 0;
        $handler->display->display_options['fields']['filename']['alter']['absolute'] = 0;
        $handler->display->display_options['fields']['filename']['alter']['word_boundary'] = 0;
        $handler->display->display_options['fields']['filename']['alter']['ellipsis'] = 0;
        $handler->display->display_options['fields']['filename']['alter']['strip_tags'] = 0;
        $handler->display->display_options['fields']['filename']['alter']['trim'] = 0;
        $handler->display->display_options['fields']['filename']['alter']['html'] = 0;
        $handler->display->display_options['fields']['filename']['hide_empty'] = 0;
        $handler->display->display_options['fields']['filename']['empty_zero'] = 0;
        $handler->display->display_options['fields']['filename']['link_to_file'] = 1;
        /* Field: Content: Body */
        $handler->display->display_options['fields']['body']['id'] = 'body';
        $handler->display->display_options['fields']['body']['table'] = 'field_data_body';
        $handler->display->display_options['fields']['body']['field'] = 'body';
        $handler->display->display_options['fields']['body']['relationship'] = 'file_to_node';
        /* Field: Content: Date */
        $handler->display->display_options['fields']['field_date']['id'] = 'field_date';
        $handler->display->display_options['fields']['field_date']['table'] = 'field_data_field_date';
        $handler->display->display_options['fields']['field_date']['field'] = 'field_date';
        $handler->display->display_options['fields']['field_date']['relationship'] = 'file_to_node';
        $handler->display->display_options['fields']['field_date']['alter']['alter_text'] = 0;
        $handler->display->display_options['fields']['field_date']['alter']['make_link'] = 0;
        $handler->display->display_options['fields']['field_date']['alter']['absolute'] = 0;
        $handler->display->display_options['fields']['field_date']['alter']['external'] = 0;
        $handler->display->display_options['fields']['field_date']['alter']['replace_spaces'] = 0;
        $handler->display->display_options['fields']['field_date']['alter']['trim_whitespace'] = 0;
        $handler->display->display_options['fields']['field_date']['alter']['nl2br'] = 0;
        $handler->display->display_options['fields']['field_date']['alter']['word_boundary'] = 1;
        $handler->display->display_options['fields']['field_date']['alter']['ellipsis'] = 1;
        $handler->display->display_options['fields']['field_date']['alter']['strip_tags'] = 0;
        $handler->display->display_options['fields']['field_date']['alter']['trim'] = 0;
        $handler->display->display_options['fields']['field_date']['alter']['html'] = 0;
        $handler->display->display_options['fields']['field_date']['element_label_colon'] = 1;
        $handler->display->display_options['fields']['field_date']['element_default_classes'] = 1;
        $handler->display->display_options['fields']['field_date']['hide_empty'] = 0;
        $handler->display->display_options['fields']['field_date']['empty_zero'] = 0;
        $handler->display->display_options['fields']['field_date']['hide_alter_empty'] = 1;
        $handler->display->display_options['fields']['field_date']['settings'] = array(
          'format_type' => 'long',
          'fromto' => 'both',
          'multiple_number' => '',
          'multiple_from' => '',
          'multiple_to' => '',
          'show_repeat_rule' => 'show',
        );
        $handler->display->display_options['fields']['field_date']['group_rows'] = 1;
        $handler->display->display_options['fields']['field_date']['delta_offset'] = '0';
        $handler->display->display_options['fields']['field_date']['delta_reversed'] = 0;
        $handler->display->display_options['fields']['field_date']['delta_first_last'] = 0;
        $handler->display->display_options['fields']['field_date']['field_api_classes'] = 0;
        /* Field: Content: Link */
        $handler->display->display_options['fields']['view_node']['id'] = 'view_node';
        $handler->display->display_options['fields']['view_node']['table'] = 'views_entity_node';
        $handler->display->display_options['fields']['view_node']['field'] = 'view_node';
        /* Field: Content: Title */
        $handler->display->display_options['fields']['title']['id'] = 'title';
        $handler->display->display_options['fields']['title']['table'] = 'node';
        $handler->display->display_options['fields']['title']['field'] = 'title';
        /* Sort criterion: File: Upload date */
        $handler->display->display_options['sorts']['timestamp']['id'] = 'timestamp';
        $handler->display->display_options['sorts']['timestamp']['table'] = 'file_managed';
        $handler->display->display_options['sorts']['timestamp']['field'] = 'timestamp';
        $handler->display->display_options['sorts']['timestamp']['order'] = 'DESC';
    
        /* Display: Page */
        $handler = $view->new_display('page', 'Page', 'page');
        $handler->display->display_options['path'] = 'test';
    
    ?>
    

    As for the correct markup surrounding the entire RSS printout, you can manipulate the views templates. To modify each record, use views-view-fields–test.tpl.php (for example). And for the wrapper around the entire view, use views-view–test.tpl.php (for example). The templates available are under the “Themes” link at the bottom of the third rail (the collapsed one) on the Views UI. Just drop the views template files into your theme’s folder and drush cc all.

    Joe

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a content type called fund. The contents of this is in node-fund.tpl.php
i have a file speakWord.php: <?php header(Content-Type: audio/mpeg); $voice = file_get_contents('http://translate.google.com/translate_tts?tl=' . urlencode($_POST['language']) .
I have a .out file which has xml content like this. <header stub> <article
I have the following code header(Content-Description: File Transfer); header('Content-Type: audio/mp3'); header(Content-Disposition: attachment; filename= .
I have a Drupal setup like this: Content type: Apartments Vocabulary: Areas , that
I have a content query web part that queries by content type against a
’ is showing on my page instead of ' . I have the Content-Type
I have a custom content type with custom fields. I'm trying to create a
I have a site content type that was used for a handful of lists
I have several different content type nodes (videos, image galleries, stories...) that I would

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.