Copied to clipboard

Flag this post as spam?

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


  • Roger 14 posts 34 karma points
    Sep 12, 2019 @ 14:42
    Roger
    0

    Umbraco.Web.MVc.UmbracoTemplatePage not in [email protected]("title")

    In umbraco 7 to get a list of announcements I would use @inherits Umbraco.Web.Mvc.UmbracoTemplatePage

    @{ var announcements = Umbraco.TypedContentSingleAtXPath("//announcementList"); }

    @foreach (var announcement in announcements.Children.Where(x => x.IsVisible() && Umbraco.MemberHasAccess(x.Path)).OrderByDescending(x => x.CreateDate)) {

    @announcement.GetPropertyValue("title")

    @announcement.GetPropertyValue("content")
    }

    in umbraco 8 I do not have Umbraco.Web.MVc.UmbracoTemplatePage. what do I use

  • Shaishav Karnani from digitallymedia.com 354 posts 1638 karma points
    Sep 12, 2019 @ 18:09
    Shaishav Karnani from digitallymedia.com
    0

    Hi Roger,

    In v8, their is no @announcement.GetPropertyValue("title") Instead you can use @announcement.Value("title")

    This is good article on how to access v8 iPublishedContent. https://our.umbraco.com/documentation/reference/querying/ipublishedcontent/Properties/

    Cheers,

    Shaishav

Please Sign in or register to post replies

Write your reply to:

Draft