autonav $navItem->level is always 1

Permalink
He all I am writing a custom template for autonav and need to know the level at which the page appears in the sitemap

code
$navItems = $controller->getNavItems();
foreach ($navItems as $ni) {
echo $ni->level;
}


ie this is what I believe I should see when I use $ni->level

home = $ni->level returns 1
products = $ni->level returns 1
product no.1 = $ni->level returns 2
product no.2 = $ni->level returns 2
sub product 1 = $ni->level returns 3

but it will always return 1 using the above code.

 
rge replied on at Permalink Reply
I have tested this in version 8.5.1 and the pages that are directly under the home page get level 1 and subpages get level 2.

What version of Concrete are you using and can you share the rest of the template code?
tryllian replied on at Permalink Reply
I am using version 8.5.1 but that being said when I tested it again this morning and behold it was all working correctly lol so now there is no problem. I did some other changes to the template last night just some cleaning up of the code that i thought was not related to this issue but must have had something in it wish I knew so I could tell you what it was lol

Thanks for the reply

This website stores cookies on your computer. These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media. To find out more about the cookies we use, see our Privacy Policy.