Thanks - yes, I applied a fix along those lines and it worked fine. But it's a patch that will need to be applied separately in each installation, and also with multiple "replaces" where there are several blogs in an installation. It will also break if our client changes the name of "club-news" to anything else.
I think this will be a recurring problem wherever the blog is not at the top level in the tree - the blog string will include the intermediate levels of the tree in the url. When combined with the url of the post, those intervining levels in the tree will be repeated.
So rather than working out the blog url, this probably needs to work out the top level domain node / url instead.
Here you go - I think that, because the blog (Club News) isn't at the top of the tree, the code which builds the url for the posts in the RSS page "double-counts" the club-news node:
Just come across another issue with this - that is if you're using an rss feed which is defined by category or by tag, then the links break again - you end up with ?category=xxx in the middle of the string.
I can see how we could strip out the ?category= using the replace method you showed above, but I'm not sure how to strip out the variable part of the string (i.e. the category name or the tag).
Create an rss feed for a blog, and filter it for a particular category (or tag) by adding ?category=xxx to the url of the rss page. You get the correct list of posts displayed on the rss page.
RSS links error in 2.0 beta
Hi
There seems to be a problem with the urls generated for the blog posts in an RSS feed.
As an example, I have a post at:
[domain]/club-news/posts/2011/september/16/[blogPost]
In the RSS feed, the (broken) link below is used:
[domain]/club-news/club-news/posts/2011/september/16/[blogPost]
Seems to be including the Landing page ("club-news") twice.
Any ideas how to fix this please?
Thanks
Allan
I'm not sure why this would happen.
A quick work around....
modify this line:
string blogUrl = Request.Url.AbsoluteUri.Replace("/rss", string.Empty).TrimEnd("/".ToCharArray());
to this:
string blogUrl = Request.Url.AbsoluteUri.Replace("/rss", string.Empty).TrimEnd("/".ToCharArray()).Replace("/club-news/club-news/", "/club-news/");
Thanks - yes, I applied a fix along those lines and it worked fine. But it's a patch that will need to be applied separately in each installation, and also with multiple "replaces" where there are several blogs in an installation. It will also break if our client changes the name of "club-news" to anything else.
I think this will be a recurring problem wherever the blog is not at the top level in the tree - the blog string will include the intermediate levels of the tree in the url. When combined with the url of the post, those intervining levels in the tree will be repeated.
So rather than working out the blog url, this probably needs to work out the top level domain node / url instead.
Can you paste a screenshot of your content tree?
Here you go - I think that, because the blog (Club News) isn't at the top of the tree, the code which builds the url for the posts in the RSS page "double-counts" the club-news node:
Looks like the image didn't save - trying again:
Here is a better fix:
string blogUrl = Request.Url.AbsoluteUri.Replace(Model.Url, string.Empty).TrimEnd("/".ToCharArray());
Thanks Anthony - that seems to do the trick!
Just come across another issue with this - that is if you're using an rss feed which is defined by category or by tag, then the links break again - you end up with ?category=xxx in the middle of the string.
I can see how we could strip out the ?category= using the replace method you showed above, but I'm not sure how to strip out the variable part of the string (i.e. the category name or the tag).
Any suggestions?
Thanks
Allan
I'm not sure what you mean.
Can you give an example?
Create an rss feed for a blog, and filter it for a particular category (or tag) by adding ?category=xxx to the url of the rss page. You get the correct list of posts displayed on the rss page.
But then look at the links for each item in the feed - and you get something in the form http://www.mydomain.com/?category=xxx/news/posts/2011/october/04/postname. ; This url breaks.
Does this make sense?
Allan
Cheers.
Thanks for the bug report.
is working on a reply...