Site Root + Menu Issues
# help-with-umbraco
s
Hey all! I have a few issues with a site I am currently building, and was hoping to get some advice. The first being that I have set up this main menu, inheriting from the SiteRoot model
Copy code
@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! 🙂
9 Views