Windows SharePoint Services v3 ships with a possibility to create RSS Feeds for every List. This feature is quite powerful as it allows you to create multiple RSS Feeds for one List based on Views. If you have worked with Lists at least a bit, you know that you can quite easily create a custom View using the standard SharePoint interface. Without any problems you will be able to define the filter and apply the sorting criteria.
When using the SharePoint RSS Feeds with Document Libraries (like for example the Pages Library in MOSS 2007) you can select an extra option called Link RSS items directly to their files which basically tells SharePoint that it should generate links not to the ListItem View Form (eg. /Pages/Forms/DispForm.aspx?ID=1), but point to the item itself, like /Pages/default.aspx. This setting is quite important to leverage the user experience the users would expect.
As soon as you turn on the Link RSS items directly to their files option you will notice, that the titles of the RSS items point now to the Title column instead of the Name column. While in case of a Document Library the choice is up to you whether to display on or the other, showing the content of the Title field for the Publishing Pages RSS will provide consistency between the site and the RSS.
If only you have worked with custom Content Types in SharePoint 2007 you have probably found yourself in a situation when you needed to change the display name of the Title column to something else. As soon as you do however, the RSS Feed will display the Name column as the title of the RSS Feed items instead of the Title column!
I have looked at how SharePoint actually generates the RSS Feed XML, but I haven't found the exact reason of this behavior. At some point the SPListItem.DisplayName Property is being called. This is where it all goes wrong I suspect.
Changing the display name of the Title column and preserving the RSS Feed experience
But what if you are required to change the display name of the Title column and yet want to benefit of the RSS Feed functionality? As far as I know you have at least two choices. First of all you could create a custom HttpHandler/Application Page which would do the same as the standard SharePoint RSS Feed generator but then without the issue I have mentioned above. As far as I can tell it's going to cost you quite some time if you want to leverage a comparable experience and attach your custom RSS Feed generator to all existing links.
Secondly you could create a Page Adapter and attach it to the ListFeed.aspx page. Using some simple Regular Expressions you could grab the contents of the not-anymore-title-column and paste it between the <title> element of the RSS Feed item. I admin that it's not a really neat solution yet it works, costs far less time to do it and limits the amount of custom code you need to support.

















June 8th, 2010 at 8:05 am
Hi Waldek,
I was battling for a solution to this problem for a while, and was considering implementing one of your suggestions, but then I went digging with Reflector.
Found out that the DisplayName property which you mentioned is being used is actually reading the string from a field called "BaseName", which is a computed field – not part of the ContentType, it's just a field added straight on the list (I guess it's a "Document Library" field).
So, after investigating why BaseName was returning the filename instead of the title, I decided modification of the computed value would be a good solution. I couldn't find anything that would require BaseName to have the document's filename.. so off I went on a SchemaXML 'hacking' trip.
The original schemaXML for the BaseName field looks like this:
1
I wrote a simple little C# WinForms app which changed the SchemaXML to this:
1
I didn't think it would work at first, but after setting that SchemaXML, the RSS feeds now display the titles of the items!! Awesome! I couldn't find any side-effects of my change either..
Here's the C# I used:
SPField bnfld = list.Fields.GetFieldByInternalName("BaseName");
if (bnfld != null)
{
bnfld.SchemaXml = @"1";
bnfld.Update();
}
You just need an SPList object (list variable), of the list (well, library) you want to fix the RSS titles for.
June 8th, 2010 at 8:10 am
Bugger, it didn't like the XML I put in, I replaced the gt's and lt's with HTML chars, hope it works this time:
(original BaseName SchemaXML)
<Field ID="{7615464b-559e-4302-b8e2-8f440b913101}" ReadOnly="TRUE" Hidden="TRUE" Type="Computed" Name="BaseName" DisplayName="Name" Filterable="FALSE" RenderXMLUsingPattern="TRUE" SourceID="http://schemas.microsoft.com/sharepoint/v3" StaticName="BaseName" FromBaseType="TRUE"><FieldRefs><FieldRef Name="FileLeafRef"/><FieldRef Name="FSObjType"/></FieldRefs><DisplayPattern><IfEqual><Expr1><LookupColumn Name="FSObjType"/></Expr1><Expr2>1</Expr2><Then><LookupColumn Name="FileLeafRef" HTMLEncode="TRUE"/></Then><Else><UrlBaseName HTMLEncode="TRUE"><LookupColumn Name="FileLeafRef"/></UrlBaseName></Else></IfEqual></DisplayPattern></Field>
(new BaseName SchemaXML)
<Field ID="{7615464b-559e-4302-b8e2-8f440b913101}" ReadOnly="TRUE" Hidden="TRUE" Type="Computed" Name="BaseName" DisplayName="Name" Filterable="FALSE" RenderXMLUsingPattern="TRUE" SourceID="http://schemas.microsoft.com/sharepoint/v3" StaticName="BaseName" FromBaseType="TRUE"><FieldRefs><FieldRef Name="Title"/><FieldRef Name="FSObjType"/></FieldRefs><DisplayPattern><IfEqual><Expr1><LookupColumn Name="FSObjType"/></Expr1><Expr2>1</Expr2><Then><LookupColumn Name="Title" HTMLEncode="TRUE"/></Then><Else><UrlBaseName HTMLEncode="TRUE"><LookupColumn Name="Title"/></UrlBaseName></Else></IfEqual></DisplayPattern></Field>
June 8th, 2010 at 8:31 pm
@dexy: thanks for the tip :D
December 22nd, 2010 at 3:37 am
Do you have an example of how to do this: "Using some simple Regular Expressions you could grab the contents of the not-anymore-title-column and paste it between the element of the RSS Feed item."
I am trying to customize the RssXslt.aspx page to render my RSS feeds without links to the display forms for my publishing site, but I am having no luck. Your solution logically makes sense but I can't quite wrap my head round it.
Thanks.
December 22nd, 2010 at 6:47 am
@Greg: You could do it with Regular Expressions but you might as well try using XmlDocument or XDocument. If you're not familiar with Regular Expressions the later might be a better solution.