D10 enclosure tag

Created on 11 April 2024, 9 months ago
Updated 16 April 2024, 9 months ago

My RSS feed includes:

<enclosure url="https:/example.com/episode4.mp3" length="50219284" type="audio/mpeg"/>

Can I map my Drupal url / text field to this enclosure tag?

πŸ’¬ Support request
Status

Active

Version

2.2

Component

User interface

Created by

πŸ‡¬πŸ‡§United Kingdom juc1

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

  • Issue created by @juc1
  • πŸ‡ΊπŸ‡ΈUnited States DamienMcKenna NH, USA

    Is that for the channel or per item? There's a per-item enclosure field available from the settings popup, does that work or do you need something different?

  • πŸ‡¬πŸ‡§United Kingdom juc1

    @Damien, ok I found the enclosure tag thanks but so far it does not seem to work for me.

    Here is an enclosure tag in a random podcast rss feed https://feed.podbean.com/thegoradiofootballshow/feed.xml - so this is what I am aiming for:

    <item>
    <title>The Go Radio Football Show 10th April</title>
    <pubDate>Wed, 10 Apr 2024 19:30:20 +0100</pubDate>
    <enclosure url="https://mcdn.podbean.com/mf/web/vyt55wvvvnj6eaya/10th_april_edit_aj13v.mp3" length="232641256" type="audio/mpeg"/>
    </item>
    

    So the url such as https://mcdn.podbean.com/mf/web/vyt55wvvvnj6eaya/10th_april_edit_aj13v.mp3 (no HTML) is my Drupal node field ie link field or plain text field giving the remote location for my mp3 file.

    So far tags such as title etc are rendered correctly but when I map the enclosure tag to my url field I don't get any error message but the enclosure tag is just not rendered in the feed ie is just ignored. Are there any restrictions about what field types / formats etc are accepted for the enclosure tag?

  • πŸ‡ΊπŸ‡ΈUnited States DamienMcKenna NH, USA

    The enclosure tag has some logic to try and parse a file, but it should also output anything else that's assigned.

    I wonder if the problem that the field itself is not outputting the correct data?

    Just to test it - if you assign the same field to a simple text element, e.g. "description", do you get the expected value in that element?

  • πŸ‡¬πŸ‡§United Kingdom juc1

    The field is a link field and the field content is a url such as https://mcdn.podbean.com/mf/web/vyt55wvvvnj6eaya/10th_april_edit_aj13v.mp3 and yes the links are output correctly / as expected in the description tag or the title tag. For example:

    <description>https://ia903405.us.archive.org/20/items/mjq-1983-montreal-jazz-festival-cbc/01-Introduction.mp3</description>

    But if I assign the same link field to the enclosure tag, the tag is not rendered. Also as a test if I assign other fields such as title / authored by to the enclosure tag it is again not rendered. The only Views field I have seen so far that will be rendered as the enclosure tag is "link to field" which renders as <enclosure>/node/4726</enclosure>

    Also I tried different remote file urls such as https://ia903405.us.archive.org/20/items/mjq-1983-montreal-jazz-festival-cbc/01-Introduction.mp3 and a url to my own website = same behaviour.

    Does a link field such as https://ia903405.us.archive.org/20/items/mjq-1983-montreal-jazz-festival-cbc/01-Introduction.mp3 render for you in the enclosure tag?

Production build 0.71.5 2024