Copied to clipboard

Flag this post as spam?

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


  • René Andersen 238 posts 684 karma points
    Jan 28, 2015 @ 10:08
    René Andersen
    0

    Tree structure / Fanoe kit

    Hi,

    I have been away from Umbraco for some time and I am about to start using version 7. I am playing with the "Fanoe" starter kit and I have some questions.

    Is the Fanoe kit the "Ultimate" way to build the menu / tree structure? Because as see it then "Home" is on a higher level than other pages on the website. See image below:


    Would it be a better solution to make "Home" on the same level as the rest of the pages on the website? See image below:


    In earlier versions of Umbraco I used "umbracoInternalRedirectId" to have a "Site Settings" as root and then all other pages was child even "Home".

    Thanks in advance!

    // René

     

  • Dennis Aaen 4500 posts 18255 karma points admin hq c-trib
    Jan 28, 2015 @ 10:22
    Dennis Aaen
    101

    Hi René,

    I would do it like they did in the Fanoe starter kit, my reasons for that is then you can use the .AncestorOrSelf(1) to get all the pages on level 1. I think by doing it like the Fanoe starter kit it will get more easier to traverse the content tree to get data.

    And if you see the guides from Umbraco on how to bulid an Umbraco site, they are also using the hierarchical structure where you have frontpage, and pages below.

    http://our.umbraco.org/documentation/Using-Umbraco/Creating-Basic-Site/Articles-Parent-and-Article-Items

    http://umbraco.tv/videos/umbraco-v7/content-editor/basics/introduction/structure-of-websites/

    Just my thoughts about this.

    /Dennis

  • René Andersen 238 posts 684 karma points
    Jan 28, 2015 @ 10:41
    René Andersen
    0

    Hi Dennis,

    Thank you for the quick answer I will use Fanoe starter kit and the guides that you provided as my starting point.

    // René

  • René Andersen 238 posts 684 karma points
    Jan 29, 2015 @ 15:03
    René Andersen
    0

    Hi again,

    With this structure I have problems with the Navigation. I am using the standard partial view navigation code see below. My problem is that "Home" is not part of the navigation. I hope that it is just a simple tweak of the code that can solve the problem. Any suggestions?

    // René

    @inherits Umbraco.Web.Mvc.UmbracoTemplatePage

    @{
    @* Get the root of the website *@
    var root = CurrentPage.AncestorOrSelf(1);
    }

    <ul>
    @foreach (var page in root.Children.Where("Visible"))
    {
    <li class="@(page.IsAncestorOrSelf(CurrentPage) ? "current" : null)">
    <a href="@page.Url">@page.Name</a>
    </li>
    }
    </ul>
  • René Andersen 238 posts 684 karma points
    Jan 29, 2015 @ 15:59
    René Andersen
    0

    I found the solution in this post from Dennis Aaen:

    http://our.umbraco.org/forum/developers/razor/60093-From-Scripting-Files-to-Partial-View-problems?p=0

    I added this line of code:

    <li class="@CurrentPage.IsEqual(root, "active", "")"><a href="/">Home</a></li>

    So thanks again Dennis! :-)

Please Sign in or register to post replies

Write your reply to:

Draft