Auto-Nav: Display Pages Beneath ...

Permalink 1 user found helpful
I'm embedding the Auto-Nav directly into a template, and want it to only display pages under a specific page (e.g. - Articles) – how do I specify that?

Here is my code:

<?php
$bt = BlockType::getByHandle('autonav');
$bt->controller->displayPages = 'current';
$bt->controller->orderBy = 'display_asc';
$bt->render('view');
?>

hugostiglitz
 
olsgreen replied on at Permalink Best Answer Reply
olsgreen
You need to find out the parent pages collection ID (i.e. Articles may have a cID of 68), then you should be able to:
$bt = BlockType::getByHandle('autonav');
  $bt->controller->cParentID = 68;
  $bt->controller->displayPages = 'current';
  $bt->controller->orderBy = 'display_asc';
  $bt->render('view');
jordanlev replied on at Permalink Reply
jordanlev
Actually, I think you need to set "displayPages" to "custom", like this:
$bt->controller->displayPages = 'custom';
hugostiglitz replied on at Permalink Reply
hugostiglitz
Thanks for responding. I did try setting the displayPages to 'custom' but it didn't work.

I appreciate the input.
hugostiglitz replied on at Permalink Reply
hugostiglitz
green2go, that worked perfectly!

Thanks so much for the help!