none
Provide a simpler RSS feed with only Feed Title, Description and date,, inside my RSS viewer web part RRS feed

  • Question

  • I am working on sharepoint server 2013, and i added a web part of type RSS viewer . then inside the XSL editor i added the following , to render only title,date & description:-

    <xsl:stylesheet xmlns:x="http://www.w3.org/2001/XMLSchema"
       version="1.0" exclude-result-prefixes="xsl ddwrt msxsl rssaggwrt" 
       xmlns:ddwrt="http://schemas.microsoft.com/WebParts/v2/DataView/runtime"
       xmlns:rssaggwrt="http://schemas.microsoft.com/WebParts/v3/rssagg/runtime"
       xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt"
       xmlns:rssFeed="urn:schemas-microsoft-com:sharepoint:RSSAggregatorWebPart"
       xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:dc="http://purl.org/dc/elements/1.1/"
       xmlns:rss1="http://purl.org/rss/1.0/" xmlns:atom="http://www.w3.org/2005/Atom"
       xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd"
       xmlns:atom2="http://purl.org/atom/ns#">
    
        <!-- sets how many items to render -->
        <xsl:param name="rss_FeedLimit">5</xsl:param>
    
        <!-- locale ID for date and time -->
        <xsl:param name="rss_LCID">1033</xsl:param>
    
        <xsl:template match="rss">
            <xsl:variable name="Rows" select="channel/item"/>
                <xsl:for-each select="$Rows">
                    <xsl:variable name="CurPosition" select="position()" />
                    <xsl:if test="($CurPosition &lt;= $rss_FeedLimit)">
                        <div class="item link-item simple-rss" >
    
                                <!-- render TITLE and link to item -->
                                <a class="rss-title" href="{ddwrt:EnsureAllowedProtocol(string(link))}" target="_blank">
                                    <xsl:value-of select="title"/>
                                </a>
    
                                <!-- format and render date -->
                                <div class="rss-pub-date">
                                    <xsl:choose>
                                        <xsl:when test="string-length(pubDate) &gt; 0">
                                            <xsl:choose>
                                                <xsl:when test="contains(pubDate, '+')">
                                                    <xsl:variable name="pubDateLength" select="string-length(pubDate) - 3" />
                                                    <xsl:value-of select="ddwrt:FormatDate(substring-before(pubDate, '+'),number($rss_LCID),3)"/>
                                                </xsl:when>
                                                <xsl:otherwise>
                                                    <xsl:variable name="pubDateLength" select="string-length(pubDate) - 3" />
                                                    <xsl:value-of select="ddwrt:FormatDate(substring(pubDate,0,$pubDateLength),number($rss_LCID),3)"/>
                                                </xsl:otherwise>
                                            </xsl:choose>
                                        </xsl:when>
                                        <xsl:otherwise>
                                            <xsl:value-of select="ddwrt:FormatDate(string(dc:date),number($rss_LCID),3)"/>
                                        </xsl:otherwise>
                                    </xsl:choose>
                                </div>
    
                                <!-- render description -->
                                <div class="rss-description">
                                    <xsl:value-of select="description" disable-output-escaping="yes"/>
                                </div>
    
                        </div>
                    </xsl:if>
                </xsl:for-each>
        </xsl:template>
    
    </xsl:stylesheet>

    now i got this result:-

    where the RSS is showing the Title,Date & Description correctly.. but the problem i am trying to solve is that how i can hide/remove the additional links such as "Email this", "Add to del.icio.us","Digg This!" , etc... ??

    Friday, March 17, 2017 1:37 AM

All replies

  • Hi,

    I think you could try to hide the content by jQuery, fake code like:

    $('selector(like .class)').each(function(index){

                        $(this).css('display', 'none');             

                })

    Here is the link about jQuery selector for your reference.

    https://api.jquery.com/category/selectors/

    Best Regards,

    Lee


    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com

    Monday, March 20, 2017 3:57 AM