Custom Template for hardcoded block

Permalink 1 user found helpful
Hi there

I'm trying to hardcode an autonav block in to my theme, which is working well using the following code

$bt = BlockType::getByHandle('autonav');
        $bt->controller->displayPages = 'second_level';
        $bt->controller->orderBy = 'display_asc';                    
        $bt->controller->displaySubPages = 'none'; 
        $bt->controller->displaySubPageLevels = 'custom';
        $bt->controller->displaySubPageLevelsNum = '3';   
        $bt->render('view');


Now my question: Is it possible to apply a custom template to this block?

 
dmennenoh replied on at Permalink Best Answer Reply
Yes, you just do like so - where you have:

$bt->render('view');

You replace with:

$bt->render('templates/custom-nav');

And then place custom-nav.php into the blocks/autonav/templates folder.