Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

Would you please help me in the below two issues:

First, How i can open the article feeds in a new tab... When we click on the "More..." Button since it's open on the same tab (How i can add the target="_blank" in the XSL)

Second, How i can display the Pub date of the article feeds under his title in the RSS Viewer layouts

Thanks for your ususal support

Regards,

share|improve this question

2 Answers 2

In order to customize the rendering of RSS Agregator web part default XSLT for RSS Feed should be changed (see Xsl property).

Usage

So, find the line for rendering feed item link:

<a href="{ddwrt:EnsureAllowedProtocol(string(link))}">More...</a>

and replace it with this one:

<a target="_blank" href="{ddwrt:EnsureAllowedProtocol(string(link))}">More...</a>

This will allow to open feed items in separate window.


Regarding PubDate, it should be rendered by default (see template RSSMainTemplate.description). Below is excerpt from it, that is used for rendering formatted PubDate:

<xsl:choose>
        <xsl:when test="string-length(pubDate) &gt; 0">
          <xsl:variable name="pubDateLength" select="string-length(pubDate) - 3" />
          <xsl:value-of select="ddwrt:FormatDate(substring(pubDate,0,$pubDateLength),number($rss_LCID),3)"/>
        </xsl:when>
        <xsl:otherwise>
          <xsl:value-of select="ddwrt:FormatDate(string(dc:date),number($rss_LCID),3)"/>
        </xsl:otherwise>
      </xsl:choose>

But of course it could be customized as well. For example to print PubDate in raw format the following Xslt could be used:

<xsl:value-of select="pubDate"/>

See the full source code for customized RSS Feed XSLT for details.


In order to display publication date for date part only the following Xslt could be used:

<xsl:value-of select="ddwrt:FormatDate(pubDate,number($rss_LCID),3)"/>
share|improve this answer
    
Thank you all for your quick reply and you help me a lot but i have another issue when i retreive the pubDate is diplayed the Date & time as ((Fri, 08 Mar 2013 23:01:54 +0000 )) how i can remove the time & +0000 ? any idea please –  HaSS Mar 11 '13 at 5:51
    
Please see my updated answer. –  Vadim Gremyachev Mar 11 '13 at 6:24
    
Thanks Vadimm you help me to understand better the XSL code in the RSS webpart :P thanks again –  HaSS Mar 11 '13 at 10:18

The RSS Web part allows for XSLT based customizations. If you are not fun of working direclty with XSLT, you could always use this XSLT to get the full RSS render as XML. This can than be used in SharePoint Designer as XML Data Source for any Data View web part, which will help you into easier manipulation.

http://zioed.wordpress.com/2012/02/24/customizing-the-sharepoint-2010-rss-viewer-web-part-part-1-of-a-two-part-post-2/

<?xml version=”1.0″ encoding=”UTF-8″?>

<xsl:stylesheet version=”1.0″ xmlns:xsl=”http://www.w3.org/1999/XSL/Transform”&gt;

<xsl:output method=”xml” version=”1.0″ encoding=”UTF-8″ indent=”yes”/>

<xsl:template match=”/”>

<xmp><xsl:copy-of select=”*”/></xmp>

</xsl:template>

</xsl:stylesheet>
share|improve this answer
    
Thank you all for your quick reply and you help me a lot but i have another issue when i retreive the pubDate is diplayed the Date & time as ((Fri, 08 Mar 2013 23:01:54 +0000 )) how i can remove the time & +0000 ? any idea please –  HaSS Mar 9 '13 at 12:35

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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