Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeDNN Open Source...DNN Open Source...Module ForumsModule ForumsNews FeedsNews Feedsyoutube rss feeds?youtube rss feeds?
Previous
 
Next
New Post
8/29/2007 6:02 PM
 

i'm no xsl pro, but understand the basics enough to add to this. 

i basically modified the sample you posted and got it to be able to embed the youtube clips into the page.  i verified this works.  i took out the more free-form item/description elements since people may or may not want those in.  i verified this works on a testing dnn 4.5.5 install. 

here's the modified version:

<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
xmlns:media="http://search.yahoo.com/mrss/"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<!-- xmlns:xsl="http://www.w3.org/TR/WD-xsl" -->
<!-- RSSv2YouTube XSL by Phil 'iwonder' Guerra -->

<xsl:output method="html" indent="yes"/>
<xsl:param name="TITLE"/>
<xsl:template match="rss">

 <xsl:apply-templates select="channel" />

 <xsl:apply-templates select="channel/item" />

</xsl:template>

 <xsl:template match="channel">
  <strong><a href="{link}" target="_blank"><xsl:value-of select="title"/></a></strong><br/>

<!--  <font size="-3"> -->
<!--  <xsl:value-of select="description" disable-output-escaping="yes"/> -->
<!--  <strong>Language: </strong><xsl:value-of select="language"/><br/> -->
<!--  (<xsl:value-of select="copyright"/>) -->
<!--  <strong>WebMaster: </strong><xsl:value-of select="webMaster"/> -->
<!--  </font>-->

  <hr/>
 </xsl:template>

<xsl:template match="channel/item">

 <strong><a href="{link}" target="_blank">
  <xsl:value-of select="title"/>
 </a></strong>
 <br/>

 <font size="-3">(<xsl:value-of select="pubDate"/>)</font>
 <br/>
  
<!--   <xsl:value-of select="description" disable-output-escaping="yes"/>
   <br/>-->
  
 <xsl:if test="enclosure/@type='application/x-shockwave-flash'">
  <object width="{media:thumbnail/@width}" height="{media:thumbnail/@height}"><param name="movie" value="{enclosure/@url}"></param><param name="wmode" value="transparent"></param><embed src="{enclosure/@url}" type="application/x-shockwave-flash" wmode="transparent" width="{media:thumbnail/@width}" height="{media:thumbnail/@height}"></embed></object>
  <br/>
  <a href="{link}" target="_blank">open in browser</a>
  <br/>
 </xsl:if>

 <hr/>
</xsl:template>

</xsl:stylesheet>

 

 
New Post
8/29/2007 7:50 PM
 

Great job!  That's what the community here is all about - sharing and collaboration.  Glad I could be a part of it.

 
New Post
8/30/2007 1:49 PM
 

Ok, just wanted to show a slight variation.  The tags that specify media width, and height, look nice for a thumbnail size, but for us older folks - the embedded video control needs to be a bit bigger, otherwise, I'd just view it on YouTube.  Also, included an example of how to go about taking apart elements of a tag to get the info you want.  The item description contains a bit more info than I wanted, so I stripped out just the main descriptions sans the image, and other keywords stuff.

Another option for displaying this type of feed with a bit more control over what elements you want to display without hardcoding in the xsl, is to use the XML/XSL module.  With that module, you could create parameters to pass an xsl that could be used to test whether to show a specifc tag or not.  I'll post something over on that forum when I get around to it.  But for now, this is the xsl I'm using.  Feel free to use it, and tweak as needed.

Now, when can we expect the Core Team blogging on YouTube, and showing this type of newsfeed on the DNN site?  Would make a nice addition for the upcoming OpenSource gathering in Europe for those not being able to attend.  A nice travel log.  What say you?

<?xml version="1.0"?>
<xsl:stylesheet version="1.0"
xmlns:media="http://search.yahoo.com/mrss/"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<!-- xmlns:xsl="http://www.w3.org/TR/WD-xsl" -->
<!-- RSSv2YouTube XSL -->
<!--   by Phil 'iwonder' Guerra -->
<xsl:output method="html" indent="yes"/>
<xsl:param name="TITLE"/>
<xsl:template match="rss">
<xsl:apply-templates select="channel" />
 <xsl:apply-templates select="channel/item" />
</xsl:template>
<xsl:template match="channel">
  <strong><a href="{link}" target="_blank"><xsl:value-of select="title"/></a></strong><br/>
  <font size="-3">
  <xsl:value-of select="substring-after(description,'/>')" disable-output-escaping="yes"/></font>
  <hr/>
</xsl:template>
<xsl:template match="channel/item">
<xsl:variable name="FirstPartDesc" select="substring-after(description,'/>')"/>
<xsl:variable name="JustText" select="substring-before($FirstPartDesc,'Author')"/>
<table>
 <tr>
  <td valign="top" width="50%"><font size="-2">
 <strong><a href="{link}" target="_blank">
 <xsl:value-of select="title"/>
  </a></strong>
  <br/>
  <font size="-1">Author: <xsl:value-of select="author"/></font> <br/>
  <font size="-3">(Published: <xsl:value-of select="pubDate"/>)</font><br/>
<xsl:value-of select="$JustText" disable-output-escaping="yes"/></font></td>
 <xsl:if test="enclosure/@type='application/x-shockwave-flash'">
  <td valign="top" width="50%" align="center"><font size="-3"><center>Click Image To Use the Control</center></font>
<br/>
  <object align="right" width="280" height="210">
  <param name="movie" value="{enclosure/@url}"></param>
  <param name="wmode" value="transparent"></param>
    <embed src="{enclosure/@url}" type="application/x-shockwave-flash" wmode="transparent" width="280" height="210"></embed>
 </object>
<br/>
  <a href="{link}" target="_blank"><font size="-3"><center>Click Here to See it at YouTube</center></font></a>
</td>
 </xsl:if>
</tr></table>
 <hr/>
</xsl:template>
</xsl:stylesheet>

 

 
Previous
 
Next
HomeHomeDNN Open Source...DNN Open Source...Module ForumsModule ForumsNews FeedsNews Feedsyoutube rss feeds?youtube rss feeds?


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out