Keyword

Need help pulling other fields from an RSS feed.

  • Sam Harney
  • Sam Harney's Avatar Topic Author
  • Offline
  • Junior Member
More
2 weeks 3 days ago - 2 weeks 3 days ago #176622 by Sam Harney
RSS Feed: www.youtube.com/feeds/videos.xml?channel_id=UCJW5hqDUc_000YBpti2GKsg
feed xmlns:yt="https://www.youtube.com/xml/schemas/2015" xmlns:media="http://search.yahoo.com/mrss/" xmlns="http://www.w3.org/2005/Atom">
<link rel="self" href="https://www.youtube.com/feeds/videos.xml?channel_id=UCJW5hqDUc_000YBpti2GKsg"/>
<id>yt:channel:UCJW5hqDUc_000YBpti2GKsg</id>
<yt:channelId>UCJW5hqDUc_000YBpti2GKsg</yt:channelId>
<title>Greg Crawford</title>
<link rel="alternate" href="https://www.youtube.com/channel/UCJW5hqDUc_000YBpti2GKsg"/>
<author>
<name>Greg Crawford</name>
<uri>https://www.youtube.com/channel/UCJW5hqDUc_000YBpti2GKsg</uri>
</author>
<published>2007-07-08T18:12:35+00:00</published>
<entry>
<id>yt:video:aNMzJqK-50o</id>
<yt:videoId>aNMzJqK-50o</yt:videoId>

I'm trying to either create a custom template for Simple RSS Feed Reader, or even modify the core module file if needed, but I need to pull this field yt:videoId. The problem is that even though I have duplicated the PHP code that pulls other fields from the XML file if I use the field title for the video id yt:videoId then I get an error message about the ":" not being expected... I've tried a ton of different ways of formating the name of the field to see if SRFR was modifying the name in the variables as it pulls the feed; however, if SRFR is doing that I cannot figure out. I need this so that I can have SRFR auto-embed the videos in the site.

Here is the code I'm trying to add into my "YouTube" template which is just a modification of the default template for this module:
<iframe width="420" height="315" src="https://www.youtube-nocookie.com/embed/<?php echo $feed->yt:videoID; ?>" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
Last edit: 2 weeks 3 days ago by Sam Harney.

Please Log in or Create an account to join the conversation.

  • Fotis
  • Fotis's Avatar
  • Offline
  • Administrator
  • JoomlaWorks Support Team
More
2 weeks 1 day ago #176626 by Fotis

If you use & love K2, please take a moment to add your review and rate it
at the Joomla Extensions Directory: extensions.joomla.org/extension/k2/


IMPORTANT: Please search the forum before posting a question!

JoomlaWorks Support Team Member

Please Log in or Create an account to join the conversation.


Powered by Kunena Forum