Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Johan 95 posts 264 karma points
    Nov 19, 2015 @ 15:03
    Johan
    0

    Top-links over the main navigation

    I'm trying to add three top links that are to work as parent of the main navigation. The three top-links are static but the main and sub menu is not. Each top-link has its own main navigation.

    Here is how the navigation tree looks like:

    enter image description here

    Please note that Top-link1 is the HomePage

    I want the pathway to be like this for example:

    "Top-link2/Menu3/submenu3" or

    "Top-link3/menu 2/submenu5"

    My question is: How should the structure be on the content? Should the top-links be included inside the HomePage or outside the HomePage? What should I do to achieve this?

  • Dennis Aaen 4500 posts 18255 karma points admin hq c-trib
    Nov 19, 2015 @ 21:47
    Dennis Aaen
    0

    Hi Johan,

    When you are saying static links will this mean that they won't change, or should the user be able to change the links.

    The way I see that you can solve this is by two different methods. The first is just to hardcode the links of the static menu into the master template of your site, and add the links to the main navigation in the a href tag.

    The other option is to add the add a multinode treepicker data type on the homepage document type. With this solution the user can add the pages that they want in the static menu. This is a more flexible solution for the user.

    The good thing with the multinode treepicker is that you can set a minium and a maximum value of items that the user should pick.

    You can find the documentation on how to configure the multinode treepicker, and get examples on how to get data outputted in Razor

    https://our.umbraco.org/documentation/getting-started/backoffice/property-editors/built-in-property-editors/multinode-treepicker

    Hope this make sense.

    /Dennis

  • Johan 95 posts 264 karma points
    Nov 20, 2015 @ 08:34
    Johan
    0

    The static links won't change. I think I'll try the first option; to hard code it into the master template. I'm just wondering how the link to the main navigation would look like?

    I tried it like this:

     <nav class="entry-links">
                        <ul>
                            <li id="elever">
                                <a href="~/" title="För elever">För elever</a>
                            </li>
                            <li id="skolpersonal">
                                <a href="@{ Html.RenderPartial("MainNavigation"); }" title="För skolpersonal">För skolpersonal</a>
                            </li>
                            <li id="ungdom">
                                <a href="@{ Html.RenderPartial("MainNavigation"); }" title="Ungdom och elevdatabas">Ungdom och elevdatabas</a>
                            </li>
                        </ul>
                    </nav>
    

    But it's not a good solution.

Please Sign in or register to post replies

Write your reply to:

Draft