Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
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)) {
in umbraco 8 I do not have Umbraco.Web.MVc.UmbracoTemplatePage. what do I use
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
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
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")
in umbraco 8 I do not have Umbraco.Web.MVc.UmbracoTemplatePage. what do I use
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
is working on a reply...