Using custom templates when calling block from php
Permalink
Hey ppl,
I'm building my first site in C5 and need some help with some code.
I'm calling the block autonav directly from the template-file (in the .php-file) with the following code:
This works perfectly but I need to change the output for autonav with a custom template. I've created the template and it works great if I add a autonav-block to a page and change the template in the web interface.
But how can I use my custom template when I call the block from the template code?
Most grateful for some help!
Sorry if my english isn't great - not my first language.
// Magnus
I'm building my first site in C5 and need some help with some code.
I'm calling the block autonav directly from the template-file (in the .php-file) with the following code:
$bt = BlockType::getByHandle('autonav'); $bt->controller->displayPages = 'top'; $bt->controller->orderBy = 'display_asc'; $bt->controller->displaySubPages = 'none'; $bt->render('view');
This works perfectly but I need to change the output for autonav with a custom template. I've created the template and it works great if I add a autonav-block to a page and change the template in the web interface.
But how can I use my custom template when I call the block from the template code?
Most grateful for some help!
Sorry if my english isn't great - not my first language.
// Magnus