$nav = BlockType::getByHandle('autonav'); $nav->controller->orderBy = 'display_asc'; $nav->controller->displayPages = 'below'; $nav->controller->displaySubPages = 'all'; $nav->controller->displaySubPageLevels = 'enough'; $nav->render('templates/subnav');
It shows the pages under the current page (because of: $nav->controller->displayPages = 'below';). I would like it to show all the sublinks under the page at the second level. But only from 1 page not all pages of the links from second level. (see attachment). I tried
I don't get it to work like I would (see attachment). Any idea or other suggestions?
On the other hand, if you actually add an Autonav block in a global area on the page, it will get executed once (slow) and then cached (very fast).
If Autonav in a global area has performance issues and your nav does not change often, use a Manual Nav or Nested Manual Nav block in a global area (both blocks in marketplace). Enable caching. Both are much more efficient than Autonav. Nested Manual Nav is a good block to use because it is 100% compatible with Autonav templates.
You can then assign your subnav template to the block through the design menu.
And going to create an extra page template to display a other autonav block with other options. That way I believe is the best way to make It as dynamic as possible.
It will cache hard-coded blocks with a nice level of control.