Copied to clipboard

Flag this post as spam?

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


  • Mr A 216 posts 278 karma points
    Dec 16, 2011 @ 17:30
    Mr A
    0

    Error loading Razor Script uBlogsyShowRSSLink.cshtml

    Using Version 1.35 (stable release)

    Umbraco Version : umbraco v 4.7.0 (Assembly version: 1.0.4090.21631)

    The blog is working fine but the rss feeds is not working when i uncomment the below line in uBlogsyBaseSite

     <%--rss link--%>
     <!-- <umbraco:Macro ID="Macro4" Alias="uBlogsyShowRSSLink" runat="server" /> -->

    On the blog page it comes up with error :

    Error loading Razor Script uBlogsyShowRSSLink.cshtmlSequence contains no elements

    Any ideas how to fix this


  • Mr A 216 posts 278 karma points
    Dec 16, 2011 @ 17:33
    Mr A
    0

    Stack Trace Error: 

    umbracoMacro Error Loading Razor Script (file: uBlogsy - Show RSS Link) Sequence contains no elements    at System.Linq.Enumerable.Single[TSource](IEnumerable`1 source)
      at ASP._Page_macroScripts_uBlogsyShowRSSLink_cshtml.Execute() in d:\inetpub\vhosts\dotraining.co.uk\httpdocs\macroScripts\uBlogsyShowRSSLink.cshtml:line 10
      at System.Web.WebPages.WebPageBase.ExecutePageHierarchy()
      at System.Web.WebPages.WebPage.ExecutePageHierarchy(IEnumerable`1 executors)
      at System.Web.WebPages.WebPage.ExecutePageHierarchy()
      at System.Web.WebPages.WebPageBase.ExecutePageHierarchy(WebPageContext pageContext, TextWriter writer, WebPageRenderingBase startPage)
      at umbraco.MacroEngines.RazorMacroEngine.ExecuteRazor(MacroModel macro, INode currentPage)
      at umbraco.MacroEngines.RazorMacroEngine.Execute(MacroModel macro, INode currentPage)
  • Anthony Dang 1404 posts 2558 karma points MVP 3x c-trib
    Dec 19, 2011 @ 11:23
    Anthony Dang
    0

    The error is "Sequence contains no elements "

    The line is : 

    var rss = landing.GetChildrenAsList.Items.Where(x => x.NodeTypeAlias =="uBlogsyRSS").Single();

    .Single() MUST return something. In this case we're looking for a node with nodeTypeAlias == uBlogsyRSS, which is a direct child of the landing node.

    Check that there is a uBlogsyRSS node under landing as a child (not a grandchild)

     

  • Mr A 216 posts 278 karma points
    Dec 19, 2011 @ 11:35
    Mr A
    0

    Thanks for pointing out to d right direction, I followed your instructions and now i can see the rss subscribe button on the website but when i click on it , it takes me to xml version, is that what it suppose to do. the link is 

    http://www.dotraining.co.uk/articles

  • Anthony Dang 1404 posts 2558 karma points MVP 3x c-trib
    Dec 19, 2011 @ 11:56
    Anthony Dang
    0

    That is exactly what is meant to happen.

    I noticed the links to your pages have an extra /articles/

    What version of uBlogsy are you using?

     

  • Mr A 216 posts 278 karma points
    Dec 19, 2011 @ 12:09
    Mr A
    0

    Waz using Using Version 1.35 (stable release) just updated to 1.3.5.1 , i am not taking any risks of updating to the latest one , the tree is like:

     Articles

     1)Blog

    1.1)General

    1.1.1)Practice what you preach

    Comment

    1.2)Basketball posts

    1.2.1) 7 dunks

    Comments

    2)Rss

     

    And for Rss feed to work should i have to connect to some third party rss feeds , I am completley new to RSS , i disabled the rss from the website but my client want to include rss , as when he add any blog , the subscribers will be able to know that the new post is added, something like this.


  • Anthony Dang 1404 posts 2558 karma points MVP 3x c-trib
    Dec 19, 2011 @ 12:22
    Anthony Dang
    0

    Just a quick fix:

    Replace

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

    with

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

     

     

  • Mr A 216 posts 278 karma points
    Dec 19, 2011 @ 15:46
    Mr A
    0

    Thanks , well i replaced the blogUrl with the one u mentioned above but the links generated doesnt works : its like 

    http://www.dotraining.co.uk/articles/rss/articles/blog/basketball-posts/guada-highlights/ 

  • Anthony Dang 1404 posts 2558 karma points MVP 3x c-trib
    Dec 19, 2011 @ 15:54
    Anthony Dang
    0

    Oops

    My mistake. Replace the whole thing with these 2 lines

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

    blogUrl = blogUrl.Replace("/article/article", "/article");

     

  • Mr A 216 posts 278 karma points
    Dec 19, 2011 @ 16:00
  • Mr A 216 posts 278 karma points
    Dec 19, 2011 @ 16:18
    Mr A
    0

    I guess this is not replacing :

     blogUrl blogUrl.Replace("/articles/articles""/articles");

  • Mr A 216 posts 278 karma points
    Dec 19, 2011 @ 18:09
    Mr A
    0

    it worked when i duplicated the code :

      string blogUrlRequest.Url.AbsoluteUri.Replace("/rss"string.Empty).TrimEnd("/".ToCharArray());
         blogUrl Request.Url.AbsoluteUri.Replace("/articles/articles"string.Empty).TrimEnd("/articles".ToCharArray());

Please Sign in or register to post replies

Write your reply to:

Draft