RSS Format problem - Please help!

Topics: ASP.NET 2.0, Business Logic Layer, Controls, Themes
Jun 4, 2009 at 9:31 AM

Hello :)

Is there a way for the syndication feed to only show the description of the article and the link (which is the title) of an article rather than the whole content? I am using the latest version of BE.

I have seen the remove and recompile posts:

http://blogengine.codeplex.com/Thread/View.aspx?ThreadId=52523              - Remove

http://blogengine.codeplex.com/Thread/View.aspx?ThreadId=42291              - Recompile

 

I have successfully done these, but it is still not what I need, and only highlights how odd this setup is. Why is it weird? well........

When looking at the XML file that contains the article there is <title>, <description> and <content> among others. <title> Is the title of the article and actually behaves as the link (which makes sense). However <description> is the brief description of the article and <content>is the actual article itself. So why does:

  1          writer.WriteElementString("title", title);
  2          writer.WriteElementString("description", this.Settings.Description);
  3          writer.WriteElementString("link", Utils.AbsoluteWebRoot.ToString());

Show the ENTIRE article when it should only show the brief description. I would have expected:

 1           writer.WriteElementString("title", title);
 2           writer.WriteElementString("description", this.Settings.content);
 3           writer.WriteElementString("link", Utils.AbsoluteWebRoot.ToString());

To show what the first one does. Here is an example of the XML structure:

 


<?xml version="1.0" encoding="utf-8" standalone="yes" ?>

 

 <post>
  <author>8bitBeat</author>
  <title>This is the title and will also act as the link</title>
  <description>This SHOULD be the short description area that I would like to show instead of the full content</description>
  <content><p>However this is what actually shows and for my RSS feed I only need the brief description not the long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long long content version</p></content>
  <ispublished>True</ispublished>
  <iscommentsenabled>False</iscommentsenabled>
  <pubDate>2009-03-05 03:27:00</pubDate>
  <lastModified>2009-06-02 04:37:05</lastModified>
  <raters>0</raters>
  <rating>0</rating>
  <slug>This-is-the-title-and-will-also-act-as-the-link</slug>
 <tags>
  <tag>RSS</tag>
  <tag>problem</tag>
  </tags>
  <comments />
 <categories>
  <category>7e74ee7f-3955-4707-94f0-8ca7cb916262</category>
  </categories>
  <notifications />
  </post>

So how do I get the syndication page to show the Title (link) / BRIEF description / Date/time stamp?

As you can see I have done my best to resolve this on my own. Please please help!!!! :(

If not then I will have to look for another solution (which is a shame as I love everything else about BlogEngine!)

Fingers Crossed

8BB

Feb 2, 2010 at 5:06 PM

Have you found a solution to this? I am facing the same issue. 

Feb 2, 2010 at 5:45 PM
Edited Feb 2, 2010 at 5:47 PM

I was able to modify the SyndicatorGenerator.cs file and add a new WriteRSSItem so that it will pick up the description field as well.

 

In the SyndicatorGenerator.cs find the following for the RSS feed - if using an ATOM feed it will be different.

//-----------------------------------------------------------
// Write required channel item elements
//------------------------------------------------------------
writer.WriteElementString("title", publishable.Title);
writer.WriteElementString("description", content);
            writer.WriteElementString("intro", publishable.Description);
writer.WriteElementString("link",Utils.ConvertToAbsolute(publishable.RelativeLink).ToString())
//------------------------------------------------------------
//	Write required channel item elements
//------------------------------------------------------------
	writer.WriteElementString("title", publishable.Title);
	writer.WriteElementString("description", content);
	writer.WriteElementString("link", Utils.ConvertToAbsolute(publishable.RelativeLink).ToString());

And add the following

 

	writer.WriteElementString("intro", publishable.Description);

 

Rebuild the application and that should do it. Please note, this was done using Version 1.6 - and may require that version.

Hope that helps.