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

jawbonelid
 
TheRealSean replied on at Permalink Reply
TheRealSean
$a->setCustomTemplate('block_name', "templates/template_name/view.php");

That should do it
jawbonelid replied on at Permalink Reply
jawbonelid
Not for me. Any other ideas?
jawbonelid replied on at Permalink Reply
jawbonelid
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...
TheRealSean replied on at Permalink Reply
TheRealSean
(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
carlzata replied on at Permalink Reply
carlzata
You can use something like this
i made a custom template for youtube block type

$a = new Area('Main Content');
$a->setCustomTemplate('youtube', 'templates/custom_theme_youtube');
$a->display($c);

This website stores cookies on your computer. These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media. To find out more about the cookies we use, see our Privacy Policy.