DEV Community

Discussion on: Extending the UmbracoHelper class in Umbraco v8

Collapse
 
dawoe profile image
Dave Woestenborghs • Edited

Hi Tim,

Getting the alias can be done a lot easier... just use Website.ModelTypeAlias

But in fact you don't need it. You can also do this :

website = UmbracoContextReference.UmbracoContext.Content.GetById(id).AncestorOrSelf<Website>();
Enter fullscreen mode Exit fullscreen mode

Personally I also would create a overload for the SiteService methods... where you can pass in a IPublishedContent so you can eliminate the the GetById call.

Collapse
 
timgeyssens profile image
Tim Geyssens

sweet, updating...