inserting autonav, automatically?
PermalinkCan anyone provide me with the code I need in order to add the autonav block onto this new single page during the package install?
Many thanks!!
$bt = BlockType::getByHandle('autonav'); $data = array(); $data['orderBy'] = 'display_asc'; $data['displayPages'] = 'top'; $data['displaySubPages'] = 'none'; $c = Page::getByPath('/sermons'); $c->addBlock($bt, 'Header Nav', $data);
It inserts the autonav block into the page, but for some reason it uses a different css class. The original pages all use class="nav-header", but this new block uses class="nav". Weird??
Secondly, I tried changing the theme to see what would happen. The autonav block disappeared from the page after the theme change. Is this a bug?
i took that out of the dev docs
im not sure what the auto nav handle is or the option variables in it but it would be something like this i think:
this adds the autonav block to an area called Main.
Hope this helps
Mike