Login

Username

Password





Register   Reset password

This is a read-only archive of the forum.

# Constructor 5/30/2009 1:07 AM (edited 5/30/2009 12:41 PM)
Where is the link determined for RSS feed items. I cant get my items from the RSS feed of my new module to link to their respective detail views (full article content).

I have found this in the Articles module:
// item.Link = "" (can't determine link here)

so I did this in mine:
item.Link = UrlHelper.GetUrlFromSection(base.Section)
                        + "/" + TechArticleAction.Details
                        + "/" + item.ItemId;

but nothing...

I will keep looking but any help would be welcome.

# Constructor 5/30/2009 12:41 PM (edited 5/30/2009 9:55 PM)
OK, here is what I found:

In 'Rss.aspx.cs' (line 101+) there is this:
// TODO: Only supports ID's in the pathinfo now...
writer.WriteElementString("link", Util.UrlHelper.GetFullUrlFromSection(section) + "/" + item.ItemId);

This seems to create the link whilst writing the feed itself :s

This prevents me from making my RSS feed work (and any other modules that I wish RSS feeds on I think).

So... I changed it to
// TODO: Only supports ID's in the pathinfo now...
//writer.WriteElementString("link", Util.UrlHelper.GetFullUrlFromSection(section) + "/" + item.ItemId);
writer.WriteElementString("link", item.Link);


So the link that is created in my 'Module' ISydicatable methods is used.

But now the Articles module feed items will not link through to the full detail view of their respective articles!

So... I had to change this line
// item.Link = "" (can't determine link here)

to...
item.Link = UrlHelper.GetFullUrlFromSection(base.Section) + "/" + item.ItemId;

Now both work and I am free to create the links to my feed items in a format different than the Articles.

I do think this would be best changed in the trunk (if not already changed or improved)

What do you think?

I will add to jira.
# martijnb 6/3/2009 1:47 PM
Patch applied.

Note that this can be a breaking change for module developers that rely on the old behaviour for generating rss links. But this is just better (and I can't think of the reason why I did it the other way :s ).