Sam
06/05/2024, 6:05 PM@inherits UmbracoViewPage<SiteRoot>
<header class="header">
<nav class="nav" aria-label="Primary Navigation">
<div class="container-fluid">
<div class="row">
<div class="col-12">
<ul class="nav-list">
<li>
<a href="/">Samuel James Forrest</a>
</li>
@if (Model.MainMenu != null && Model.MainMenu.Any())
{
@foreach (var link in Model.MainMenu)
{
<li>
<a href="@link.Url" alt="@link.Name">@link.Name</a>
</li>
}
}
</ul>
</div><!-- col -->
</div><!-- row -->
</div><!-- container -->
</nav>
</header>
However, when I run this I get the following error: ModelBindingException: Cannot bind source content type Umbraco.Cms.Web.Common.PublishedModels.Homepage to model type Umbraco.Cms.Web.Common.PublishedModels.SiteRoot.
And secondly, I've set up a content picker to choose a homepage - also within SiteRoot - but I'm not sure how best to use it to redirect users to that page when they visit the '/'
url
TIA! 🙂