Set custom template
Permalink
I want to specify a block template in an area within my theme. I know I can do this like so:
$a->setCustomTemplate('block_type', 'template_name.php');
This works when the file is located in
/blocks/block_type/templates/template_name.php
but what if the file is in
/blocks/block_type/templates/template_name/view.php
I've tried everything (I think) but the template is not being found...
Thanks
Joe
$a->setCustomTemplate('block_type', 'template_name.php');
This works when the file is located in
/blocks/block_type/templates/template_name.php
but what if the file is in
/blocks/block_type/templates/template_name/view.php
I've tried everything (I think) but the template is not being found...
Thanks
Joe
Not for me. Any other ideas?
My mistake. Looks like 'templates/custom_template_name/view.php' or 'custom_template_name' loads the view.php fine but either way view.js is not being loaded. However, view.js DOES load OK if the custom template is selected for a block using the CMS interface...
(Googling the setCustomHeader brought me back here)
I know its an old thread and you have probably moved on but,
Will the js load if the view.js is placed within a folder called "js"
ie /custom_tmplate_name/js/custom_javascript.js
It may not work? if the view.js don't, but could be worth a go
I know its an old thread and you have probably moved on but,
Will the js load if the view.js is placed within a folder called "js"
ie /custom_tmplate_name/js/custom_javascript.js
It may not work? if the view.js don't, but could be worth a go
You can use something like this
i made a custom template for youtube block type
i made a custom template for youtube block type
$a = new Area('Main Content'); $a->setCustomTemplate('youtube', 'templates/custom_theme_youtube'); $a->display($c);
That should do it