Custom template for block
Permalink Browser Info Environment
Hey -
I'm calling the testimonials block from a page template and I can't get it to use a custom view template. Here's my code:
What am I missing?
Thanks in advance.
I'm calling the testimonials block from a page template and I can't get it to use a custom view template. Here's my code:
<?php $bt = BlockType::getByHandle('defunct_testimonials'); $bt->render('templates/custom1'); ?>
What am I missing?
Thanks in advance.
Type: | Discussion |
---|---|
Status: | New |
I don't have a file named custom1.php... It's a template that's here:
/blocks/defunct_testimonials/templates/custom1/view.php
This template works when applied to the block's "custom templates" menu... Should it not work when calling the 'render' method?
/blocks/defunct_testimonials/templates/custom1/view.php
This template works when applied to the block's "custom templates" menu... Should it not work when calling the 'render' method?
Try
/blocks/defunct_testimonials/templates/custom1.php
/blocks/defunct_testimonials/templates/custom1.php
That seems to have worked! Many thanks for your help.
When I had created custom templates before I thought it had to be that path/format... "[root]/blocks/block_name/templates/template_name/view.php"
So, did this change at some point in the last couple years? Or is this something unique to packages as opposed to regular blocks?
When I had created custom templates before I thought it had to be that path/format... "[root]/blocks/block_name/templates/template_name/view.php"
So, did this change at some point in the last couple years? Or is this something unique to packages as opposed to regular blocks?
I just read this:
http://www.concrete5.org/index.php?cID=49182...
http://www.concrete5.org/index.php?cID=49182...
Cool, thanks again!
Where did you put your custom1.php file?