Copied to clipboard

Flag this post as spam?

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


  • Kleber Hucalo 26 posts 165 karma points
    Jul 30, 2014 @ 05:46
    Kleber Hucalo
    0

    Show list of post in home page

    Hi all

    I would like to display a list of posts in my home page, I am on umbraco mvc app.

    Created a partial view footer and placed there:

    @Html.CachedPartial("uBlogsy/Widgets/uBlogsyWidgetListPostsForHome", Model, 0, false, true, new ViewDataDictionary(ViewData) { { "ItemLimit", 5 } })

    Its display fine for

            home

            home/about-us

    however when I tried to go to

            home/about-us/someone

    it does not work, the error is line 68 "Sequence contains no elements":

    IPublishedContent GetLanding() {

    var landing = Model.Content.FollowingSibling("uBlogsyLanding");

    if (landing == null) {

    var startNode = this.Model.Content.Parent ?? this.Model.Content;

    line 68: landing = startNode.DescendentsOrSelf("uBlogsyLanding", new[] { "uBlogsyLanding", "uBlogsyPage", "uTagsyTagContainer", "uCommentsyConfiguration", "uCommentsyContainerComment", "uCommentsyComment" }).First();

    } return landing;

    }}

    Any idea how to fix it?

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies