Yes, your problem is that every page will need to contain the toolsLinks property.
In your patial view yoou need to get a reference to the 'home' page to look up the toolsLinks. Something like
var site = Umbraco.ContentAtRoot().FirstOrDefault(c=>c.ContentType.Alias == "home");
var toolsList = site?.Value<IEnumerable<IPublishedElement>>("toolsLinks");
Getting values from home doc type in master template
Hi,
I've got a show hide dropdown that I want to appear on every page (quick links)
I created a nested doc type with a compostiion on the home page and linked it to a partial view.
It works fine on the home page and the show /hide will work but if I visit any other pages they just error.
Anyone know whats wrong? I assume its because I'm adding my partial view to the Master template but thats so the show/hide appears on every page.
Here is my partialview in my master template
Thanks
Hi Matt,
Yes, your problem is that every page will need to contain the toolsLinks property.
In your patial view yoou need to get a reference to the 'home' page to look up the toolsLinks. Something like
is working on a reply...