How do i get the site root from an IpublishedElement.
Model.Root()
doesnt work as Model is the IpublishedElement
Compiler Error Message: CS1929: 'IPublishedElement' does not contain a
definition for 'Root' and the best extension method overload
'PublishedContentExtensions.Root(IPublishedContent)' requires a
receiver of type 'IPublishedContent'
site root from ipublishedelement
How do i get the site root from an IpublishedElement.
doesnt work as Model is the IpublishedElement
Ahhh
Hi Claus
In the view you can access the
IPublishedContent
viaUmbracoHelper
(Umbraco) orUmbracoContext
.or
https://our.umbraco.com/forum/templates-partial-views-and-macros/94410-get-current-root-node-from-nested-content-partial-view
You can also use
Umbraco.ContentAtRoot()
, but with multiple root nodes, you might need to filter it further./Bjarne
is working on a reply...