1

I am trying to embed google news feed into sharepoint 2010 via RSS webpart. I took the rss feed from the google news as like this. When I embed this into sharepoint RSS webpart it is showing feed is not in correct format. But if I use the CNN news feed(http://rss.cnn.com/rss/cnn_topstories.rss) it is displaying properly. Is there any work around for the google news to display on the sharepoint page?

Following is the error message in the sharepoint page. enter image description here

  • could you please share the screen shot which you think is not in proper format? – Waqas Sarwar MVP Oct 13 '14 at 15:28
  • @WaqasSarwarMCSE Thanks for your reply. Please find my edited question which contains error screen shot – Mihir Oct 14 '14 at 5:27
4

Try using the same Google RSS feed URL without HTTPS, then it should work.

so instead of

https://news.google.com/news/feeds?cf=all&ned=in&hl=en&topic=n&output=rss

use

http://news.google.com/news/feeds?cf=all&ned=in&hl=en&topic=n&output=rss

I did a quick test and it worked in SP when using the HTTP URL but not with the HTTPS one.

Edit: There is no default way of changing the sort order of the feed it will be displayed as it comes. However for this specific feed it has publishing date included. You can try to use that date together with xsl:sort. If you edit the web part and select Data View Properties and then Edit XSL... Here you can modify the XSL schema and add the row <xsl:sort select="pubDate" order="descending" /> in the xsl:template element named RSSMainTemplate.body right after the first <xsl:for-each select="$Rows">.

so it will finally look something like this:

<xsl:template name="RSSMainTemplate.body" xmlns:ddwrt="http://schemas.microsoft.com/WebParts/v2/DataView/runtime" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt">
<xsl:param name="Rows"/>
<xsl:param name="RowCount"/>
<xsl:for-each select="$Rows">
  <!-- Pub date sorting --->
  <xsl:sort select="pubDate" order="descending"/> 
  <xsl:variable name="CurPosition" select="position()" />
  <xsl:variable name="RssFeedLink" select="$rss_WebPartID" />
  <xsl:variable name="CurrentElement" select="concat($RssFeedLink,$CurPosition)" />
  <xsl:if test="($CurPosition &lt;= $rss_FeedLimit)">
    <div class="item link-item" >
      <a href="{concat(&quot;javascript:ToggleItemDescription('&quot;,$CurrentElement,&quot;')&quot;)}" >
        <xsl:value-of select="title"/>
      </a>
     <!-- Added line to see the pub date --->
      <xsl:value-of select="pubDate"/>
      <xsl:if test="$rss_ExpandFeed = true()">
        <xsl:call-template name="RSSMainTemplate.description">
          <xsl:with-param name="DescriptionStyle" select="string('display:block;')"/>
          <xsl:with-param name="CurrentElement" select="$CurrentElement"/>
        </xsl:call-template>
      </xsl:if>
      <xsl:if test="$rss_ExpandFeed = false()">
        <xsl:call-template name="RSSMainTemplate.description">
          <xsl:with-param name="DescriptionStyle" select="string('display:none;')"/>
          <xsl:with-param name="CurrentElement" select="$CurrentElement"/>
        </xsl:call-template>
      </xsl:if>
    </div>
  </xsl:if>
</xsl:for-each>

  • Thanks for that. You tried in SP 2010 or SP 2013? – Mihir Oct 14 '14 at 8:10
  • I tested in SP 2010. – Robban1980 Oct 14 '14 at 8:18
  • Okay I will check.. How to sort the feed by date? is it possible? – Mihir Oct 14 '14 at 8:25
  • Please check my updated answer, i had success using xsl:sort order to sort the feed on Publishing date. – Robban1980 Oct 15 '14 at 6:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.