autonav attributes
Permalink
Hi all,
I have spent all night going through everything I can possibly think of to get a definitive answer, but to no avail.
I am trying to use an autonav in my template file, but it is continuously only coming up with my Home page and I can't figure out why:
Can any of you tell me how I can get everything on the site? All levels, all subpages, etc.
I have spent all night going through everything I can possibly think of to get a definitive answer, but to no avail.
I am trying to use an autonav in my template file, but it is continuously only coming up with my Home page and I can't figure out why:
$inc_topnav = BlockType::getByHandle('autonav'); $inc_topnav->controller->orderBy = 'display_asc'; $inc_topnav->controller->displayPages = 'top'; $inc_topnav->controller->displayPagesCID = 0; $inc_topnav->controller->displayPagesIncludeSelf = 0; $inc_topnav->controller->displaySubPages = 'all'; $inc_topnav->controller->displaySubPageLevels = 'all'; $inc_topnav->controller->displaySubPageLevelsNum = 0; $inc_topnav->controller->displayUnavailablePages = 0; $inc_topnav->render('templates/topnav');
Can any of you tell me how I can get everything on the site? All levels, all subpages, etc.
Thanks Scott. However I don't just want a list of cID's as it will require a lot of further sorting, I want to include an autonav using an autonav template. This is a similar code included in my theme:
As you know header_menu.php is one of the preinstalled templates, however, when called like this from a theme, it only produces:
Can anyone help me as to why it does not include the rest of the pages in the list?
I have tried simply adding an autonav block into an area on one of the pages and it works fine for both my autonav template and the header_menu template. Why doe sit not work when hard coded into the theme?
I have also tried to provide all the parameters like in my original post to the autonav object, but to no avail.
$a = BlockType::getByHandle('autonav'); $a->render('templates/header_menu');
As you know header_menu.php is one of the preinstalled templates, however, when called like this from a theme, it only produces:
<ul class="nav-header"> <li class="nav-selected first"><a class="nav-selected" href="/">Home</a></li> </ul><div class="ccm-spacer"> </div>
Can anyone help me as to why it does not include the rest of the pages in the list?
I have tried simply adding an autonav block into an area on one of the pages and it works fine for both my autonav template and the header_menu template. Why doe sit not work when hard coded into the theme?
I have also tried to provide all the parameters like in my original post to the autonav object, but to no avail.
$kidpages = $c->getCollectionChildrenArray(); I believe, you can pass in a 1 to that function and you'll only get one level, which will give you direct children of that page.
otherwise you'll get all the pages but not in any sort of real order, just all pages regardless of where they are under the page you're asking for the kids of, which in the case of my blog app tends to be a lot :-/