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
Hi guys,
Does anyone know if i can do this is razor?
@{
var result = umbraco.ContentAtXPath(//News).Where( "Select the first News article where section = 'Sports'");
}
Section is a custom dropdownlist datatype for the News Document Type.
Hi Thomas,
Try this code:
var result = Umbraco.TypedContentAtRoot().First().Descendants().Where(x => x.DocumentTypeAlias.Equals("News") && x.GetPropertyValue<string>("section").Equals("Sports"));
Thanks,
Alex
is working on a reply...
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.
Continue discussion
UmbracoHelper Filter
Hi guys,
Does anyone know if i can do this is razor?
@{
var result = umbraco.ContentAtXPath(//News).Where( "Select the first News article where section = 'Sports'");
}
Section is a custom dropdownlist datatype for the News Document Type.
Hi Thomas,
Try this code:
Thanks,
Alex
is working on a reply...
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.