Steve Ward
Steve Ward

Reputation: 1217

Sitecore - Rss feeds remove link

Using SiteCore 6.5, and we want to remove the link from rss items (this is because they are just informational alerts and there isn't a page to link to).

In Feeds/Design for this alert template, I can enter a Title, Body, and Date but how do I remove the link? I guess I need to customise the alert RSS template somehow ...

Upvotes: 0

Views: 653

Answers (1)

user459491
user459491

Reputation:

You have to look with Dot Peek or Reflector to this class:

Sitecore.Web.UI.WebControls.FeedRenderer 

You have to create your own class where you copy above class and modify it.

On method RenderItem is called other method AddLink. Please remove it.

After on Sitecore Backend go to :

  /sitecore/layout/Renderings/System/Feeds/FeedRenderer 

and modify next fields : Namespace,Tag,Assembly with your own values .

UPDATE:

I modify the class, it will inherits from FeedRender :

 public class CFeedRenderer : Sitecore.Web.UI.WebControls.FeedRenderer

We need this change because on FeedDeliveryLayout we have above code, and it's checking in FeedManager if is type of FeedRenderer

try
  {
    this.Response.Output.Write(FeedManager.Render(FeedManager.GetFeed(obj).Render()));
  }
What I wrote first time is also correct . 

This is my result of code :

      <rss xmlns:a10="http://www.w3.org/2005/Atom" version="2.0">
      <channel>
         <title>RSS Feed</title>
           <link>http://localhost/mylink.aspx</link>
           <description>dsds</description>
           <language>en</language>
         <item>
            <guid isPermaLink="false">{692ECF97-3443-4832244-8D56-54544343}</guid>
            <title>2</title>
            <description>B</description>
            <pubDate>Sat, 30 Nov 2013 21:24:25 +0100</pubDate>
          </item>
          <item>
            <guid isPermaLink="false">{B6330E10-D4B5-491B-AFB3-FB30484321AA}</guid>
            <title>3</title>
            <description>B</description>
            <pubDate>Sat, 30 Nov 2013 21:24:19 +0100</pubDate>
          </item>
     </channel>
   </rss>

Upvotes: 1

Related Questions