Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Allan Hawkey 232 posts 303 karma points
    Sep 24, 2011 @ 13:59
    Allan Hawkey
    0

    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

     

  • Anthony Dang 1404 posts 2558 karma points MVP 3x c-trib
    Sep 25, 2011 @ 23:07
    Anthony Dang
    0

    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/");

     

     

     

     

     

     

  • Allan Hawkey 232 posts 303 karma points
    Sep 26, 2011 @ 09:20
    Allan Hawkey
    0

    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.

  • Anthony Dang 1404 posts 2558 karma points MVP 3x c-trib
    Sep 26, 2011 @ 10:32
    Anthony Dang
    0

    Can you paste a screenshot of your content tree?

  • Allan Hawkey 232 posts 303 karma points
    Sep 26, 2011 @ 10:59
    Allan Hawkey
    0

    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:

  • Allan Hawkey 232 posts 303 karma points
    Sep 26, 2011 @ 11:38
    Allan Hawkey
    0

    Looks like the image didn't save - trying again:

  • Allan Hawkey 232 posts 303 karma points
    Sep 26, 2011 @ 11:39
    Allan Hawkey
    0

  • Anthony Dang 1404 posts 2558 karma points MVP 3x c-trib
    Sep 26, 2011 @ 18:33
    Anthony Dang
    0

     

    Here is a better fix:

     

    string blogUrl = Request.Url.AbsoluteUri.Replace(Model.Url, string.Empty).TrimEnd("/".ToCharArray());

     

     

  • Allan Hawkey 232 posts 303 karma points
    Sep 26, 2011 @ 19:06
    Allan Hawkey
    0

    Thanks Anthony - that seems to do the trick!

  • Allan Hawkey 232 posts 303 karma points
    Oct 06, 2011 @ 11:53
    Allan Hawkey
    0

    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

  • Anthony Dang 1404 posts 2558 karma points MVP 3x c-trib
    Oct 10, 2011 @ 16:44
    Anthony Dang
    0

    I'm not sure what you mean.

    Can you give an example?

     

  • Allan Hawkey 232 posts 303 karma points
    Oct 10, 2011 @ 16:53
    Allan Hawkey
    0

    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

  • Anthony Dang 1404 posts 2558 karma points MVP 3x c-trib
    Oct 13, 2011 @ 17:20
    Anthony Dang
    0

    Cheers.

    Thanks for the bug report.

     

Please Sign in or register to post replies

Write your reply to:

Draft