https://discord.umbraco.com logo
#random-coding
Title
# random-coding
c

craig100

05/10/2022, 1:36 PM
In a V8 partial how can we get the Root and siblings when coding a partial? I've tried
Copy code
Model.Root().Siblings().FirstOrDefault(x => x.ContentType.Alias == "myDocTypeAlias")
(the Root() turns red) and
Copy code
Umbraco.Web.Composing.Current.UmbracoHelper.ContentAtRoot().FirstOrDefault(x => x.ContentType.Alias == "myDocTypeAlias")
(the Web turns red). Is there a "using" I'm missing maybe? Model in this instance is a surface ViewModel. Panic over:
Copy code
Umbraco.ContentAtRoot().FirstOrDefault(x => x.ContentType.Alias == "myDocTypeAlias")
!