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 FeedsGoing Crazy! Data is not displayedGoing Crazy! Data is not displayed
Previous
 
Next
New Post
2/20/2009 1:22 PM
 

Here's the very basic bits of what must be done...

First you need to include a reference to a custom namespace that describes you custom elements in both the newsfeed, and the xsl, something like this will work:
 xmlns:custTags="http://www.mydomain.com"

In your news feed the elements are generate like this:
 <custTags:agent>Joe Blow1</custTags:agent>
 <custTags:direct>N/A </custTags:direct>
 <custTags:cell>(361) 111-1111</custTags:cell>
 <custTags:email>joeblow1@stx.rr.com</custTags:email>

Then, you reference them with the calls in the xsl like this:

  <xsl:value-of select='custTags:agent'/>
   <xsl:value-of select='custTags:direct'/> 
   <xsl:value-of select='custTags:cell'/>
    <xsl:value-of select='custTags:email'/>
 

Then, you can use the News Feed v3.x module to render it on a DNN site.  Note, this will not work using the News v4.x module.

So, a practical example...

First the xml (newsfeed)

<?xml version="1.0" encoding="utf-8"?>
<rss version="2"
 xmlns:custTags="http://www.mydomain.com"
 xmlns:dc="http://purl.org/dc/elements/1.1/" >
  <channel>
    <title>From the Home Office</title>
    <link>http://www.somewherevalid.com/</link>
    <description>Our Area Agents</description>
    <pubDate>Thu, 24 Feb 2005 21:53:00 GMT</pubDate>
    <lastBuildDate>Thu, 24 Feb 2005 21:53:00 GMT</lastBuildDate>
    <generator>HGWorks - HandCoded NewsWriter</generator>
    <ttl>1440</ttl>
<item>
 <title>NW Region Contacts</title>
    <description>NorthWest Region Agent</description>
 <link>http://www.somewherevalid.com</link>
 <dc:creator>Phil 'iwonder' Guerra</dc:creator>
 <custTags:agent>Joe Blow1</custTags:agent>
 <custTags:direct>N/A </custTags:direct>
 <custTags:cell>(361) 111-1111</custTags:cell>
 <custTags:email>joeblow1@stx.rr.com</custTags:email>
  <pubDate>Thu, 24 Feb 2005 21:53:00 GMT</pubDate>
</item>
<item>
 <title>NE Region Contacts</title>
  <description>NorthEast Region Agent</description>
 <link>http://www.somewherevalid.com</link>
 <dc:creator>Phil 'iwonder' Guerra</dc:creator>
 <custTags:agent>Joe Blow2</custTags:agent>
 <custTags:direct>N/A</custTags:direct>
 <custTags:cell>(361) 222-2222</custTags:cell>
 <custTags:email>joeblow2@stx.rr.com</custTags:email>
  <pubDate>Thu, 24 Feb 2005 21:53:00 GMT</pubDate>
</item>
<item>
 <title>SW Region Contacts</title>
    <description>SouthWest Region Agent</description>
 <link>http://www.somewherevalid.com</link>
 <dc:creator>Phil 'iwonder' Guerra</dc:creator>
 <custTags:agent>Joe Blow3</custTags:agent>
 <custTags:direct>N/A</custTags:direct>
 <custTags:cell>(361) 333-3333</custTags:cell>
 <custTags:email>joeblow3@stx.rr.com</custTags:email>
  <pubDate>Thu, 24 Feb 2005 21:53:00 GMT</pubDate>
</item>
  </channel>
</rss>

And the XSL file...

<?xml version='1.0' encoding='UTF-8'?>
<!-- Using Custom Namespace Tags -->
<!-- Phil 'iwonder' Guerra -->
<!-- 2009-02-21 -->
<!-- Version v1.0 -->
<xsl:stylesheet
 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
 xmlns:dc="http://purl.org/dc/elements/1.1/"
 xmlns:custTags="http://www.mydomain.com"
 version="1.0">
<xsl:template match='/rss'>
 <xsl:value-of select='channel/title'/>
 <hr/>
 <table BORDER="1" CELLPADDING="3" CELLSPACING="1"  >
 <th>Region</th>
 <th>Agent </th>
 <th>Direct</th>
 <th>Cell  </th>
 <th>Email </th>
 <xsl:apply-templates select='channel/item' />
 </table>
</xsl:template>
<xsl:template match='item'>
<xsl:variable name="emailLink" select="custTags:email"/>
 <tr>
  <td >
   <xsl:value-of select='description' disable-output-escaping='yes' />
  </td>
  <td>
   <xsl:value-of select='custTags:agent'/>
  </td>
  <td>
   <xsl:value-of select='custTags:direct'/> 
  </td>
  <td>
   <xsl:value-of select='custTags:cell'/>
  </td>
  <td>
   <a href="{$emailLink}">
    <xsl:value-of select='custTags:email'/></a>
  </td>
 </tr>
</xsl:template>
</xsl:stylesheet>

I create the newsfeed and xsl using a simple text editor then upload it to my DNN site, and use the DNN News v3.0.1 module specifing the xml file for the source, and the xsl file for the xsl to render it.

With DNNv8.0.4 I get output like this:

From the Home Office


Region Agent Direct Cell Email
NorthWest Region Agent Joe Blow1 N/A (361) 111-1111 joeblow1@stx.rr.com
NorthEast Region Agent Joe Blow2 N/A (361) 222-2222 joeblow2@stx.rr.com
SouthWest Region Agent Joe Blow3 N/A (361) 333-3333 joeblow3@stx.rr.com

 
New Post
2/21/2009 12:18 PM
 

 You Rock dude!  :)  Above and beyond.  Thank you for taking time out of your busy schedule to help with this.  I have to say I'm really impressed.  Thank you for your help. 


http://www.idsconsulting.com Ideas, Design, Success.
 
Previous
 
Next
HomeHomeDNN Open Source...DNN Open Source...Module ForumsModule ForumsNews FeedsNews FeedsGoing Crazy! Data is not displayedGoing Crazy! Data is not displayed


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