Previously when creating a Navigation partial I was able to use this type of syntax.
@inherits Umbraco.Web.Mvc.UmbracoViewPage
@{
var homePage = Model.AncestorOrSelf
Also could use and then all I had to do was loop through
@foreach (var page in Model.AncestorOrSelf(1).Children.Where(x => x.IsVisible()))
I am now attempting this in Umbraco 9 and all I get is this un helpful error
'ViewsPartials__Navigation' does not contain a definition for 'AncestorOrSelf' and the best extension method overload 'PublishedContentExtensions.AncestorOrSelf
Creating a menu system in Umbraco 9
Previously when creating a Navigation partial I was able to use this type of syntax.
@inherits Umbraco.Web.Mvc.UmbracoViewPage
@{ var homePage = Model.AncestorOrSelf
Also could use and then all I had to do was loop through
@foreach (var page in Model.AncestorOrSelf(1).Children.Where(x => x.IsVisible()))
I am now attempting this in Umbraco 9 and all I get is this un helpful error
'ViewsPartials__Navigation' does not contain a definition for 'AncestorOrSelf' and the best extension method overload 'PublishedContentExtensions.AncestorOrSelf
Could anybody enlighten me please.
Thanks in advance.
It sounds like you do not have a using of
In the view or the _ViewImports.cshtml
Hello, thank you for replying. Both _ViewImports and my partial have the @using Umbraco.Extensions;
Maybe I am missing something in the appsettings.json file? I am fairly new to CMS Umbraco so even the IPublished is a bit confusing.
is working on a reply...