Remove 'PostContent' data from RSS feed

Topics: Controls
Apr 7, 2009 at 9:09 AM
I do not want to syndicate the 'PostContent' data in the RSS feeds. How can I strip this so it only shows the Title and Description plus links etc.
Apr 7, 2009 at 6:23 PM
In the SyndicationGenerator.cs file (in the BE core files), there's a WriteRssItem() method.  In there is this line:

writer.WriteElementString("description", content);

The 'content' variable is used a couple of times.  So before it is first used, setting 'content' to an empty string would omit the post content.

That's for the RSS feed.  For the Atom feed, the change is similar.  In the WriteAtomEntry() method, the post content is in a similar 'content' variable and outputted twice.  Before it is used, you would want to set the 'content' variable to an empty string.

After making these changes, you would want to recompile the BE core.
Apr 8, 2009 at 9:45 AM
Edited Apr 8, 2009 at 9:49 AM
Is there a way to around this without having to recompile, I'm good with classic ASP but learning ASP.NET and feel this is most likely beyond me. In fact I haven't a clue as to how to "recompile the BE core"!
Apr 8, 2009 at 5:37 PM
The only thing you can do if you don't want to recompile is to re-create the whole RSS feed yourself.  This would be a lot more involved compared to a recompile.

A recompile is actually easy -- once you get the hang of it.  I explained the steps required in this discussion (see Dec 15th post outlining 4 steps).  Visual C# 2008 Express Edition is free.  You could download and install Express Edition, then open up the BE core code in Express Edition, make the changes and recompile.  Let me know if you have any questions about this process ...